Skip to content
Bun
Bun
Streams

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.

Was this page helpful?Suggest editsRaise issue