Bun 提供許多方便函式,可將 ReadableStream
的內容讀取為不同的格式。
const stream = new ReadableStream();
const buf = await Bun.readableStreamToArrayBuffer(stream);
請參閱 文件 > API > 公用程式,以取得 Bun 其他 ReadableStream
轉換函式的文件。
Bun 提供許多方便函式,可將 ReadableStream
的內容讀取為不同的格式。
const stream = new ReadableStream();
const buf = await Bun.readableStreamToArrayBuffer(stream);
請參閱 文件 > API > 公用程式,以取得 Bun 其他 ReadableStream
轉換函式的文件。
HTTP
讀取檔案
執行時期
公用程式
WebSocket