The current implementation of napi_create_buffer uses a TypedArray under the hood, which has slightly different characteristics compared to a Buffer. To ensure consistency in the underlying structure, we should provide a proper implementation that aligns with the behaviour of Buffer.
Reference: Buffers and TypedArrays
The current implementation of
napi_create_bufferuses aTypedArrayunder the hood, which has slightly different characteristics compared to aBuffer. To ensure consistency in the underlying structure, we should provide a proper implementation that aligns with the behaviour ofBuffer.Reference: Buffers and TypedArrays