hildjj / node-cbor

Encode and decode CBOR documents, with both easy mode, streaming mode, and SAX-style evented mode.
MIT License
362 stars 74 forks source link

ES2015 ArrayBuffers instead of node.js Buffers #52

Closed apowers313 closed 3 years ago

apowers313 commented 7 years ago

It would be nice if there were a way for the parser to generate ES2015 ArrayBuffers rather than node.js Buffers, for compatibility with APIs that will be consuming ArrayBuffers. Otherwise, it becomes necessary to recursively find and convert Buffers to ArrayBuffers.

hildjj commented 3 years ago

Are you sure you want an ArrayBuffer, not a Uint8Array?

hildjj commented 3 years ago

if anyone has a half-decent argument for ArrayBuffer, I'll change the patch. Waiting a few days before I land it.