I noticed that the package currently emits the following Node.js deprecation warning:
(node:<pid>) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues.
Please use Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() instead.
This warning appears because new Buffer() is used in the implementation of _readChunk:
const readBuffer = new Buffer(this.options.readChunk);
Recommended Fix
Replace:
const readBuffer = new Buffer(this.options.readChunk);
With the modern, safe alternative:
const readBuffer = Buffer.alloc(this.options.readChunk);
Why this matters
new Buffer() has been deprecated since Node.js 10.
It triggers runtime warnings and causes noise in logs.
Would you consider updating the package to use Buffer.alloc() instead?
Happy to submit a PR if helpful!
I noticed that the package currently emits the following Node.js deprecation warning:
This warning appears because new Buffer() is used in the implementation of _readChunk:
const readBuffer = new Buffer(this.options.readChunk);Recommended Fix
Replace:
const readBuffer = new Buffer(this.options.readChunk);With the modern, safe alternative:
const readBuffer = Buffer.alloc(this.options.readChunk);Why this matters
new Buffer() has been deprecated since Node.js 10.
It triggers runtime warnings and causes noise in logs.
Would you consider updating the package to use Buffer.alloc() instead?
Happy to submit a PR if helpful!