to-arraybuffer
Get an ArrayBuffer from a Buffer as fast as possible
Last updated 11 years ago by jhiesey .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install to-arraybuffer 
SYNC missed versions from official npm registry.

to-arraybuffer Build Status

Sauce Test Status

Convert from a Buffer to an ArrayBuffer as fast as possible.

Note that in some cases the returned ArrayBuffer is backed by the same memory as the original Buffer (but in other cases it is a copy), so modifying the ArrayBuffer is not recommended.

This module is designed to work both in node.js and in all browsers with ArrayBuffer support when using the Buffer implementation provided by Browserify.

Usage

var toArrayBuffer = require('to-arraybuffer')

var buffer = new Buffer(100)
// Fill the buffer with some data

var ab = toArrayBuffer(buffer)
// `ab` now contains the same data as `buffer`

License

MIT

Current Tags

  • 1.0.1                                ...           latest (11 years ago)

1 Versions

  • 1.0.1                                ...           11 years ago
Maintainers (1)
Downloads
Total 17
Today 0
This Week 1
This Month 11
Last Day 0
Last Week 4
Last Month 0
Dependencies (0)
None
Dev Dependencies (2)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE