question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

checking for the existence of Buffer causes it to exist

See original GitHub issue

Some modules check for the existence of Buffer but don’t require it to work. Because the identifier Buffer is seen by browserify, it becomes bundled. Buffer addes quite a lot of code to a bundle that often isn’t needed. (About 40kB)

An example of this is if you require clone, which checks if Buffer exists, and therefore causes it to be added to a browserified bundle.

It would be handy to be able to explicitly tag that your module does not require Buffer in the package.json (even if you use the Buffer identifier in your source) to allow for it to be not added if possible.

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:27 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
ghostcommented, Sep 16, 2015

I’m in favor of adding a special check for Buffer.isBuffer() that doesn’t include all of Buffer. This should live in insert-module-globals.

1reaction
hossain5630commented, Dec 21, 2018

Very nice

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chemistry of buffers and buffers in our blood - Khan Academy
Buffer, as we have defined, is a mixture of a conjugate acid-base pair that can resist changes in pH when small volumes of...
Read more >
How can I check if a current buffer exists in Emacs?
A new buffer is created if there is no live buffer named name. If name starts with a space, the new buffer does...
Read more >
What is a buffer? PreLab 3.5 - ACC Media Streaming
Buffers are extremely important to living organisms because all biochemical processes proceed normally only when the pH remains close to 7. Check your...
Read more >
Checking if there exists a buffer whose name starting with a ...
Function try-completion tests whether a given string can be completed against a given set of completions (e.g. strings).
Read more >
Blood as a Buffer - Chemistry LibreTexts
In the body, there exists another equilibrium between hydronium and oxygen which involves the binding ability of hemoglobin. An increase in ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found