brfs icon indicating copy to clipboard operation
brfs copied to clipboard

Replaces Buffer( by Buffer.from(

Open arcanis opened this issue 5 years ago • 1 comments

The Buffer constructor is deprecated for security reason; Node recommends using Buffer.from() instead in such situations. Until it's fixed, it'll print annoying warning messages.

arcanis avatar Sep 30 '18 19:09 arcanis

Thanks! It would be nice if we could still support very old environments that don't have Buffer.from (browserify itself works all the way back to Node 0.8! maybe even 0.6, but CI doesn't 100% support that anymore, so I'm not sure…)

Perhaps we can do (Buffer.from||Buffer)( instead, and add a test that does delete Buffer.from; fs.readFileSync(...)? I think that should work for new and old Nodes.

goto-bus-stop avatar Oct 01 '18 07:10 goto-bus-stop