---
title: Convert a ReadableStream to an array of chunks
description: "Collect every chunk of a `ReadableStream` into an array with `Bun.readableStreamToArray()`."
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#bunreadablestreamto).
