ReadableStream: locked property

Baseline 2022

Newly available

Since June 2022, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

Note: This feature is available in Web Workers.

The locked read-only property of the ReadableStream interface returns whether or not the readable stream is locked to a reader.

A readable stream can have at most one active reader at a time, and is locked to that reader until it is released. A reader might be obtained using ReadableStream.getReader() and released using the reader's releaseLock() method.


A boolean value indicating whether or not the readable stream is locked.


const stream = new ReadableStream({
  // ...

const reader = stream.getReader();

// should return true, as the stream has been locked to a reader


Streams Standard
# ref-for-rs-locked②

Browser compatibility

BCD tables only load in the browser

See also