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

The [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) class provides a number of methods for consuming its contents in different formats, including `.arrayBuffer()`.

```ts
const blob = new Blob(["hello world"]);
const buf = await blob.arrayBuffer();
```

---

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