Closed
Description
Background:
- Electron 21 breaks api compatability with some modules abi-stable-node#441
- node-api: handle no support for external buffers node#45181
- [Bug]: Electron 21 breaks node-api stability guarantees electron/electron#35801
After nodejs/node#45181 it is possible for Buffer::new
to fail with napi_no_external_buffers_allowed
. A helper method Buffer::NewOrCopy
which would try to do a Buffer::new
and fallback to doing a Buffer::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.
Metadata
Metadata
Assignees
Labels
No labels