Node's fs accepts both Buffers and Uint8Arrays.
(example: https://nodejs.org/api/fs.html#fs_fs_write_fd_buffer_offset_length_position_callback)
This library doesn't work with typed arrays because it sometimes uses Buffer#copy, which doesn't exist on Uint8Arrays.
Current workaround:
Uint8Array.prototype.copy = function copy(...args) {
return Buffer.from(this.buffer).copy(...args);
};
Node's
fsaccepts bothBuffers andUint8Arrays.(example: https://nodejs.org/api/fs.html#fs_fs_write_fd_buffer_offset_length_position_callback)
This library doesn't work with typed arrays because it sometimes uses
Buffer#copy, which doesn't exist onUint8Arrays.Current workaround: