pierrec / node-lz4

LZ4 fast compression algorithm for NodeJS
MIT License
438 stars 98 forks source link

new Buffer() is deprecated, use Buffer.from() #91

Closed dludwig closed 4 years ago

dludwig commented 4 years ago

DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. at showFlaggedDeprecation (buffer.js:159:11) at new Buffer (buffer.js:174:3) at Object. ({redacted}/node_modules/lz4/lib/static.js:9:30)

thanks

ankon commented 4 years ago

Having this call isn't just "annoying", but actually costs speed: NodeJS will check for each buffer constructor call whether it possibly needs to log this warning, and these checks appear in profiles in our application.