Files
2026-08-27 21:09:14 +00:00

17 lines
471 B
Plaintext

---
title: Convert a ReadableStream to an array of chunks
sidebarTitle: Stream to array
mode: center
---
`Bun.readableStreamToArray` reads the contents of a [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream) into an array of chunks.
```ts
const stream = new ReadableStream();
const chunks = await Bun.readableStreamToArray(stream);
```
---
See [Bun's other `ReadableStream` conversion functions](/runtime/utils#bun-readablestreamto).