Skip to main content

Convert a ReadableStream to JSON

Bun provides several conveniences for reading the contents of a ReadableStream into other formats. To read a stream and parse it as JSON, call its json() method.

const stream = new ReadableStream();
const json = await stream.json();

See Bun's other ReadableStream conversion functions.

Translation © 2026 fanyi.dev · Original © 2026 the Bun project (LICENSE.md names no copyright holder) (MIT)