safe-buffer
safe-buffer copied to clipboard
Add the `buffer` polyfill as a dependency
In browser-based environments, require("buffer") will fail unless
buffer is available as a dependency and can be provided by a
bundler. This used to automatically be the case in e.g. older
versions of Webpack, but since Webpack v5 no longer automatically
includes polyfills for Node built-ins, it can happen that the
buffer polyfill is no longer available in a project's dependency
tree.
Fixes #18 and https://github.com/nodejs/readable-stream/issues/448.
safe buffer is only needed for node < v6 you should be using Buffer directly instead. or better yet, use Uint8Array instead. it's better for cross compatibility