Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since June 2022.
Note: This feature is available in Web Workers.
The TransformStreamDefaultController interface of the Streams API provides methods to manipulate the associated ReadableStream and WritableStream.
When constructing a TransformStream, the TransformStreamDefaultController is created. It therefore has no constructor. The way to get an instance of TransformStreamDefaultController is via the callback methods of TransformStream().
Returns the desired size to fill the readable side of the stream's internal queue.
Enqueues a chunk (single piece of data) in the readable side of the stream.
TransformStreamDefaultController.error()Errors both the readable and writable side of the transform stream.
TransformStreamDefaultController.terminate()Closes the readable side and errors the writable side of the stream.
In the following example, a transform stream passes through all chunks it receives as Uint8Array values, using the error() and enqueue() methods.
| Streams # ts-default-controller-class |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Apr 22, 2024 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.