將 ReadableStream 轉換為 Blob
Bun 提供了多種便利方法,用於將 ReadableStream 的內容讀取為其他格式。要將流讀取為 Blob,請呼叫其 blob() 方法。
TypeScript
const stream = new ReadableStream();
const blob = await stream.blob();
Bun.readableStreamToBlob(stream) 的作用相同,但現已棄用,建議改用 stream.blob()。