1 of 20
2 of 20
3 of 20
4 of 20
5 of 20
6 of 20
7 of 20
8 of 20
9 of 20
10 of 20
11 of 20
12 of 20
13 of 20
14 of 20
15 of 20
16 of 20
17 of 20
18 of 20
19 of 20
20 of 20



The ReadableStream interface is a feature of the Streams API that allows the reading of streams of byte data. The Fetch API provides a specific instance of a ReadableStream that can be accessed through the “body” property of a Response object.


ReadableStream() Creates and returns a readable stream object from the given handlers.

Instance properties

ReadableStream.locked Returns a boolean indicating whether or not the readable stream is locked to a reader.

Instance methods

ReadableStream.cancel() Returns a Promise that resolves when the stream is canceled. Calling this method signals a loss of interest in the stream by a consumer. The supplied reason argument will be given to the underlying source, which may or may not use it.

ReadableStream.getReader() Creates a reader and locks the stream to it. While the stream is locked, no other reader can be acquired until this one is released.

ReadableStream.pipeThrough() Provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair.

ReadableStream.pipeTo() Pipes the current ReadableStream to a given WritableStream and returns a Promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.

ReadableStream.tee() The tee method tees this readable stream, returning a two-element array containing the two resulting branches as new ReadableStream instances. Each of those streams receives the same incoming data.

Async iteration

ReadableStream implements the async iterable protocol. This enables asynchronous iteration over the chunks in a stream using the for await…of syntax.

For more information on ReadableStream visit MDN Web Docs.

Didn’t find what you were looking for? Open a support ticket.