> ## Documentation Index
> Fetch the complete documentation index at: https://bun.zhcndoc.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 将 Node.js Readable 转换为 Uint8Array

要在 Bun 中将 Node.js 的 `Readable` 流转换为 `Uint8Array`，你可以用该流作为主体创建一个新的 `Response` 对象，然后使用 `bytes()` 将流读取为 `Uint8Array`。

```ts theme={"theme":{"light":"github-light","dark":"dracula"}}
import { Readable } from "stream";
const stream = Readable.from(["Hello, ", "world!"]);
const buf = await new Response(stream).bytes();
```
