Sha256: f530a901191a96f13dcc8acfd7cb55a912d8bfb330ebb21b16f12152faf49d9c

Contents?: true

Size: 940 Bytes

Versions: 43

Compression:

Stored size: 940 Bytes

Contents

# to-arraybuffer [![Build Status](https://travis-ci.org/jhiesey/to-arraybuffer.svg?branch=master)](https://travis-ci.org/jhiesey/to-arraybuffer)

[![Sauce Test Status](https://saucelabs.com/browser-matrix/to-arraybuffer.svg)](https://saucelabs.com/u/to-arraybuffer)

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](https://www.npmjs.com/package/buffer).

## Usage

``` js
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

Version data entries

43 entries across 42 versions & 15 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/to-arraybuffer/README.md
disco_app-0.18.0 test/dummy/node_modules/to-arraybuffer/README.md
disco_app-0.18.2 test/dummy/node_modules/to-arraybuffer/README.md
disco_app-0.16.1 test/dummy/node_modules/to-arraybuffer/README.md
disco_app-0.15.2 test/dummy/node_modules/to-arraybuffer/README.md
disco_app-0.18.4 test/dummy/node_modules/to-arraybuffer/README.md
disco_app-0.18.1 test/dummy/node_modules/to-arraybuffer/README.md
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/to-arraybuffer/README.md
disco_app-0.14.0 test/dummy/node_modules/to-arraybuffer/README.md
disco_app-0.13.6.pre.puma.pre.3 test/dummy/node_modules/to-arraybuffer/README.md
tang-0.2.1 spec/tang_app/node_modules/to-arraybuffer/README.md
groonga-client-model-6.0.0 test/apps/rails6.0.3.5/node_modules/to-arraybuffer/README.md
groonga-client-model-6.0.0 test/apps/rails6.1.3/node_modules/to-arraybuffer/README.md
ruby2js-4.0.4 lib/tasks/testrails/node_modules/to-arraybuffer/README.md
ruby2js-4.0.3 lib/tasks/testrails/node_modules/to-arraybuffer/README.md
tang-0.2.0 spec/tang_app/node_modules/to-arraybuffer/README.md
tang-0.1.0 spec/tang_app/node_modules/to-arraybuffer/README.md
tang-0.0.9 spec/tang_app/node_modules/to-arraybuffer/README.md
enju_library-0.3.8 spec/dummy/node_modules/to-arraybuffer/README.md
ilog-0.4.1 node_modules/to-arraybuffer/README.md