Detalhes do pacote

buffer-to-arraybuffer

miguelmota2mMIT0.0.6

Convert Buffer to ArrayBuffer

buffer, array

readme (leia-me)

buffer-to-arraybuffer

Convert Buffer to ArrayBuffer

Install

npm install buffer-to-arraybuffer

Usage

var bufferToArrayBuffer = require('buffer-to-arraybuffer');

var b = new Buffer(12);
b.write('abc', 0);

var ab = bufferToArrayBuffer(b);
String.fromCharCode.apply(null, new Uint8Array(ab)); // 'abc'

NOTE: If you only target node v4.3+, you can simply just do:

new Buffer([12]).buffer

License

MIT

changelog (log de mudanças)

Change Log

All notable changes to this project will be documented in this file.