Skip to content

napi is missing method to create buffer from ArrayBuffer #54440

Closed
@ronag

Description

@ronag

What is the problem this feature will solve?

Not possible to create Buffer from ArrayBuffer with napi

What is the feature you are proposing to solve the problem?

Add signature similar to what we have for typed arrays:

napi_status napi_create_typedarray(napi_env env,
                                   napi_typedarray_type type,
                                   size_t length,
                                   napi_value arraybuffer,
                                   size_t byte_offset,
                                   napi_value* result) 
napi_status napi_create_buffer(napi_env env,
                               size_t length,
                               napi_value arraybuffer,
                               size_t byte_offset,
                               napi_value* result) 

What alternatives have you considered?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bufferIssues and PRs related to the buffer subsystem.feature requestIssues that request new features to be added to Node.js.node-apiIssues and PRs related to the Node-API.

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions