runk / node-chardet

Character encoding detection tool for NodeJS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Replace use of `new Buffer()` (e.g. with `Buffer.alloc()`)

jacobq opened this issue · comments

commented

It looks like here and here this code is using new Buffer() to create a Buffer object. However, current versions of node have a newer API for this, and in 10.x one will see a deprecation warning like "[DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.".

This affects downstream project as well, e.g. yarnpkg/yarn#5477

Fixed in v0.7.0