Skip to main content
Bun.readableStreamToArrayBuffer reads the contents of a ReadableStream into an ArrayBuffer.
const stream = new ReadableStream();
const buf = await Bun.readableStreamToArrayBuffer(stream);

See Bun’s other ReadableStream conversion functions.