Add underscore#isArray shim and browser section to package.json to reduce browserified size #17

wants to merge 1 commit into


None yet
2 participants

This PR reduces the size of the library from 50 K to 8 K when it is browserified (see Browserify). It does so by adding a shim for the underscore depencency that only incldudes the isArray method (as this is the only method used from underscore). The code for the shim is more or less copied from underscore. The shim is only used when the module is browserified, in node, the original underscore dependency is used.

Actually, #15 is the better fix for this, so if #15 ever gets merged, you can close this one without merging. In case you want to keep the underscore dependency for node (though I see no good reason to want this), this PR provides an alternative that makes this fine module nicer for browserify users.

Looking forward to hear your thoughts on either #15 or this one :-)


s3u commented Mar 11, 2014

Merged #15. Apologies for the delay.

s3u closed this Mar 11, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment