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.
ing_mutable.zig?h=guides-3&id=cd0774cd89f44ae3880ae5d3840787012d9df603&follow=1'>Implement --test-name-pattern (#3998)Gravatar dave caruso 8-7/+151 2023-08-05Fix(cli/init): support subpath entrypoint. (#4002)Gravatar Ai Hoshino 1-1/+8 2023-08-05Remove Bun.plugin transpiler hook, encourage usage of `--preload` instead (#3...Gravatar dave caruso 5-243/+1 2023-08-04Support --dev/-D and support more flags on bun install (#3989)Gravatar Colin McDonnell 5-9/+14 2023-08-04fix macro string escaping (#3967)Gravatar Dylan Conway 4-8/+97 2023-08-04Fixes #3991Gravatar Jarred Sumner 2-4/+40 2023-08-04[install] handle `workspace:*` correctly (#3994)Gravatar Alex Lam S.L 2-54/+158 2023-08-04Update import-meta.mdGravatar Jarred Sumner 1-2/+1 2023-08-04Fix incorrect docsGravatar Jarred Sumner 1-2/+3 2023-08-04[types] fix `blob.json()` (#3995)Gravatar Alex Lam S.L 1-4/+4 2023-08-04FFI typo (#3973)Gravatar dave caruso 3-5/+10 2023-08-04Buffer.copy should ignore out-of-range sourceEnd (#3971)Gravatar Yifei Wang 2-17/+34 2023-08-04[install] store resolved workspace path in lockfile (#3974)Gravatar Alex Lam S.L 5-82/+187 2023-08-04Fix types (#3963)Gravatar Colin McDonnell 14-274/+892 2023-08-04feat(hot-clear-screen): clear terminal on hot reload (#3976)Gravatar simylein 1-0/+7