mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 10:58:56 +00:00
15 lines
467 B
Markdown
15 lines
467 B
Markdown
---
|
|
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](https://bun.sh/docs/api/binary-data#conversion) for complete documentation on manipulating binary data with Bun.
|