Skip to content

Conversation

@michaelrhodes
Copy link

Hey there, thanks for writing this module! I’m pretty sensitive about browserify bundle sizes, so I thought I’d point out that you can yield quite a substantial saving by swapping out Buffer.isBuffer for feross/is-buffer (see below).

# Buffer.isBuffer
$ browserify index.js | sizeist
.js 36.06 kB
.min.js 16.9 kB
.min.js.gz 5.19 kB
# feross/is-buffer
$ browserify index.js | sizeist
.js 1.86 kB
.min.js 1.03 kB
.min.js.gz 496 B

@jhiesey
Copy link
Owner

jhiesey commented Jan 14, 2016

When would you use to-arraybuffer when browserify isn't already pulling in the full Buffer module elsewhere? If there's a valid use case I'll merge this.

Also, I should be able to remove the require('buffer') entirely and Browserify should pull in feross/is-buffer automatically, but I was running into some trouble with this. I'll take a look at what's wrong there as well.

jimmywarting added a commit to jimmywarting/to-arraybuffer that referenced this pull request Jul 9, 2021
@jimmywarting jimmywarting mentioned this pull request Jul 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants