FreadableStreamToText
Bun

function

readableStreamToText

): Promise<string>;

Consume all data from a ReadableStream until it closes or errors.

Concatenate the chunks into a single string. Chunks must be a TypedArray or an ArrayBuffer. If you need to support chunks of different types, consider readableStreamToBlob.

@param stream

The stream to consume.

@returns

A promise that resolves with the concatenated chunks as a String.

Referenced types

class ReadableStream<R = any>

This Streams API interface represents a readable stream of byte data. The Fetch API offers a concrete instance of a ReadableStream through the body property of a Response object.

MDN Reference