Replace deprecated Buffer constructors with Buffer.from/Buffer.alloc#80
Replace deprecated Buffer constructors with Buffer.from/Buffer.alloc#80and3k5 wants to merge 1 commit intofoliojs:masterfrom
Conversation
|
I would also appreciate the merging of this request. It seems straightforward enough and removes an unnecessary ERROR from the logs for many people. It also affects all PDFKit users since it's a dependency of PDFKit. |
velkoborsky
left a comment
There was a problem hiding this comment.
Replaces deprecated functionality with recommended replacement as described in https://nodejs.org/docs/latest-v18.x/api/buffer.html#new-bufferarray
The replacements are available since Node 4
https://nodejs.org/docs/latest-v4.x/api/buffer.html#buffer_buffer_from_buffer_alloc_and_buffer_allocunsafe
|
Hey, bumping this PR. It's becoming more and more important to get this out. |
|
Hi! Really appreciate your effort solving this. Reference: foliojs/pdfkit#1504 |
new Buffer()has been deprecated for a while now while still being used in the node.js version.I've replaced the constructor call with their new replacements which is
Buffer.from()andBuffer.alloc().Reference:
https://nodejs.org/docs/latest-v18.x/api/buffer.html