[ Web Proxy ]
URL:
Viewing: https://developers.cloudflare.com/workers/runtime-apis/streams/readablestream/ [Back]  [Original]

ReadableStream Cloudflare Workers docsSkip to content
SearchCtrlKLog in
  1. Home
  2. /Workers
  3. /
  4. /Streams
  5. /ReadableStream

ReadableStream

Last updated Apr 23, 2026Copy as MarkdownView as MarkdownAgent setup
OverviewBackgroundPropertiesMethodsPipeToOptionsRelated resources

Background

A ReadableStream is returned by the readable property inside TransformStream.

Properties

  • locked boolean
    • A Boolean value that indicates if the readable stream is locked to a reader.

Methods

  • pipeTo(destinationWritableStream, optionsPipeToOptions) : Promise<void>

    • Pipes the readable stream to a given writable stream destination and returns a promise that is fulfilled when the write operation succeeds or rejects it if the operation fails.
  • getReader(optionsObject) : ReadableStreamDefaultReader

    • Gets an instance of ReadableStreamDefaultReader and locks the ReadableStream to that reader instance. This method accepts an object argument indicating options. The only supported option is mode, which can be set to byob to create a ReadableStreamBYOBReader, as shown here:
let reader = readable.getReader({ mode: 'byob' });

PipeToOptions

  • preventClose bool

    • When true, closure of the source ReadableStream will not cause the destination WritableStream to be closed.
  • preventAbort bool

    • When true, errors in the source ReadableStream will no longer abort the destination WritableStream. pipeTo will return a rejected promise with the error from the source or any error that occurred while aborting the destination.

PreviousOverviewNextReadableStream BYOBReader

Was this helpful?

YesNo
Edit pageReport issue
[]

Web Proxy Viewer  |  New URL  |  Original Page