Bun 提供了許多便捷函數,用於將 ReadableStream 的內容讀取為不同格式。
ts
const stream = new ReadableStream();
const buf = await Bun.readableStreamToArrayBuffer(stream);請參閱 文檔 > API > 工具函數 獲取 Bun 其他 ReadableStream 轉換函數的文檔。