-
Notifications
You must be signed in to change notification settings - Fork 462
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
Provide a new Buffer::NewOrCopy
method
#1257
Comments
We discussed in the team meeting today, and we agreed it would make sense to add. @legendecas volunteered to put together a PR. |
This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made. |
Landed in #1273. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Background:
After nodejs/node#45181 it is possible for
Buffer::new
to fail withnapi_no_external_buffers_allowed
. A helper methodBuffer::NewOrCopy
which would try to do aBuffer::new
and fallback to doing aBuffer::copy
would be helpful and encourage users to code in a way which provides compatibility for both electron and nodejs, without them having to implement the method themselves.The npm package sharp has implemented this themselves already lovell/sharp@584807b#diff-53a01d31aa585021f8f316c6613dadef86bf1f9ac2070d52daa68adbefbb6ef4.
The text was updated successfully, but these errors were encountered: