Skip to main content
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.