brfs
brfs copied to clipboard
Replaces Buffer( by Buffer.from(
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.
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.