Skip to content
NewBun 1.4.5 is out. Release notes
AphrodyBun

Guides · Streams

Convert a ReadableStream to a string

Read the entire contents of a ReadableStream into a string with its .text() method.

Bun provides several conveniences for reading the contents of a ReadableStream into other formats. To read a stream into a string, call its text() method.

const stream = new ReadableStream();
const str = await stream.text();

Bun.readableStreamToText(stream) does the same thing, but is deprecated in favor of stream.text().


See Bun's other ReadableStream conversion functions.