Skip to content

Conversation

@and3k5
Copy link

@and3k5 and3k5 commented May 10, 2023

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() and Buffer.alloc().

Reference:
https://nodejs.org/docs/latest-v18.x/api/buffer.html

@velkoborsky
Copy link

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.

Copy link

@velkoborsky velkoborsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@JoseCoque
Copy link

Hey, bumping this PR. It's becoming more and more important to get this out.

@abcoscar
Copy link

Hi! Really appreciate your effort solving this.
It would be really great if this came out so other libs can bump their versions and solve this issue which floods more and more logs.

Reference: foliojs/pdfkit#1504

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants