Skip to main content

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.

要在 Bun 中将 Node.js 的 Readable 流转换为 Blob,可以使用该流作为主体创建一个新的 Response 对象,然后使用 response.blob() 将流读取为 Blob
import { Readable } from "stream";
const stream = Readable.from(["Hello, ", "world!"]);
const blob = await new Response(stream).blob();