Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace deprecated Buffer constructors with Buffer.from/Buffer.alloc #80

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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.

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.

3 participants