# buffer-to-arraybuffer

> Convert Buffer to ArrayBuffer

Latest version **0.0.6** (published 2021-02-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install buffer-to-arraybuffer
pnpm add buffer-to-arraybuffer
yarn add buffer-to-arraybuffer
bun add buffer-to-arraybuffer
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2021-02-21 |
| First published | 2014-12-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Miguel Mota |
| Maintainers | miguelmota |
| Keywords | buffer, array |

## Links

- npm: https://www.npmjs.com/package/buffer-to-arraybuffer
- Repository: https://github.com/miguelmota/buffer-to-arraybuffer
- Issues: https://github.com/miguelmota/buffer-to-arraybuffer/issues
- npm.io page: https://npm.io/package/buffer-to-arraybuffer

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 0.0.6 (latest) — 2021-02-21
- 0.0.5 — 2017-07-09
- 0.0.4 — 2015-12-28
- 0.0.3 — 2015-12-22
- 0.0.2 — 2014-12-11
- 0.0.1 — 2014-12-11

## README

# buffer-to-arraybuffer

> Convert Buffer to ArrayBuffer

# Install

```bash
npm install buffer-to-arraybuffer
```

# Usage

```javascript
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:

```javascript
new Buffer([12]).buffer
```

# License

MIT

---
_Source: https://npm.io/package/buffer-to-arraybuffer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
