Repository navigation
napi is missing method to create buffer from ArrayBuffer #54440
Copy link
Copy link
Closed
Labels
bufferIssues and PRs related to the buffer subsystem.Issues and PRs related to the buffer subsystem.feature requestIssues requesting new Node.js features.Issues requesting new Node.js features.node-apiIssues and PRs related to Node-API.Issues and PRs related to Node-API.
Description
Activity
- addedfeature requestIssues requesting new Node.js features.Issues requesting new Node.js features.
on Aug 18, 2024 - addedbufferIssues and PRs related to the buffer subsystem.Issues and PRs related to the buffer subsystem.node-apiIssues and PRs related to Node-API.Issues and PRs related to Node-API.
on Aug 18, 2024 Would like to work on it , and discuss more on it
I think his feature would bring the API in line with the existing napi_create_typedarray function
@ronag @redyetidevReacted by Robert NagyWe already have a functionin in src/node_api.cc , should we update this function or create new one with different name
@ronag @redyetidev
like to discuss on these 2 also , like reference and structure if already done for any other module
// Get the underlying ArrayBuffer data
// Create a Buffer from the ArrayBuffernapi_status NAPI_CDECL napi_create_buffer(napi_env env, size_t length, void** data, napi_value* result) { NAPI_PREAMBLE(env);napi_create_buffer_from_array_bufferor something?Reacted by Shubham Singh SugaraThough the same name regarding the other 2 points have any idea ?
Please use
napi_status node_api_create*
That is, the prefix should not be
napi_for new APIs, butnode_api_.- added a commit that references this issue
on Oct 11, 2024 - added a commit that references this issue
on Nov 27, 2024
Metadata
Metadata
Assignees
Labels
bufferIssues and PRs related to the buffer subsystem.Issues and PRs related to the buffer subsystem.feature requestIssues requesting new Node.js features.Issues requesting new Node.js features.node-apiIssues and PRs related to Node-API.Issues and PRs related to Node-API.
Type
Projects
- StatusShow more project fieldsDone
What is the problem this feature will solve?
Not possible to create
BufferfromArrayBufferwith napiWhat is the feature you are proposing to solve the problem?
Add signature similar to what we have for typed arrays:
What alternatives have you considered?
No response