buffer-es

1.0.0 • Public • Published

Buffer ES

The node.js buffer module made by Feross is a super easy way to convert a typedArray to a buffer that can be serialized with JSON.stringify.

This can be used together with new FileReader() and you can convert the result to a buffer.

const reader = new FileReader();
reader.onload = function(event) {
  const result = event.target.result;
  const filebuffer = Buffer.from(result)
  console.log(JSON.stringify({ file: filebuffer }));
};
reader.readAsArrayBuffer(DOMNODE.files[0]);

Readme

Keywords

none

Package Sidebar

Install

npm i buffer-es

Weekly Downloads

3

Version

1.0.0

License

ISC

Unpacked Size

56.7 kB

Total Files

4

Last publish

Collaborators

  • kevinsimper