safe-buffer icon indicating copy to clipboard operation
safe-buffer copied to clipboard

Add the `buffer` polyfill as a dependency

Open Vinnl opened this issue 4 years ago • 2 comments

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.

Vinnl avatar Jul 05 '21 14:07 Vinnl

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

jimmywarting avatar Aug 31 '21 23:08 jimmywarting