Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use is-buffer module to reduce bundle size. #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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