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

Porting to the Buffer.from()/Buffer.alloc() #98

Merged
merged 2 commits into from
May 22, 2019
Merged

Porting to the Buffer.from()/Buffer.alloc() #98

merged 2 commits into from
May 22, 2019

Conversation

vfcp
Copy link

@vfcp vfcp commented Mar 27, 2019

The propose of this PR is to move from deprecated and unsafe Buffer() and new Buffer() constructors to safer Buffer.from()/Buffer.alloc().

In order to keep support for Node versions <6, safer-buffer polyfill was added. safer-buffer was already a dependency from iconv-lite.

The guidelines used for these changes are described Node porting guide Variant 1 and Variant 2

Later, when old Node versions support is no longer required or not possible to support, all that is required is to remove the safer-buffer polyfill and dependency.

Changes where tested with and without polyfill.

@coveralls
Copy link

coveralls commented Mar 27, 2019

Coverage Status

Coverage decreased (-62.7%) to 13.115% when pulling 47b5135 on vfcp:new_buffer into a896244 on farhadi:master.

@vfcp vfcp mentioned this pull request Mar 27, 2019
@farhadi farhadi merged commit 47b5135 into farhadi:master May 22, 2019
@farhadi
Copy link
Owner

farhadi commented May 22, 2019

Thanks for the PR!
I just merged it.

@juliangut juliangut mentioned this pull request Nov 11, 2019
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