> ## 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 转换为 Blob

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

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