将 Node.js Readable 转换为 Uint8Array
要在 Bun 中将 Node.js Readable 流转换为 Uint8Array,请以该流作为正文创建一个 Response,然后调用 bytes()。
TypeScript
import { Readable } from "stream";
const stream = Readable.from(["Hello, ", "world!"]);
const buf = await new Response(stream).bytes();