> ## 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 转换为字符串

要在 Bun 中将 Node.js 的 `Readable` 流转换为字符串，你可以创建一个以该流为主体的新 [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response) 对象，然后使用 [`response.text()`](https://developer.mozilla.org/en-US/docs/Web/API/Response/text) 将流读取为字符串。

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