aboutsummaryrefslogtreecommitdiff
path: root/docs/guides/binary/buffer-to-arraybuffer.md
blob: 56ba78a00a832f4e4ade809f6185040f92d26623 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
---
name: Convert a Buffer to an ArrayBuffer
---

The Node.js [`Buffer`](https://nodejs.org/api/buffer.html) class provides a way to view and manipulate data in an underlying `ArrayBuffer`, which is available via the `buffer` property.

```ts
const nodeBuf = Buffer.alloc(64);
const arrBuf = nodeBuf.buffer;
```

---

See [Docs > API > Binary Data](/docs/api/binary-data#conversion) for complete documentation on manipulating binary data with Bun.