TransformStreamDefaultController: terminate() method

Baseline Widely available

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 terminate() method of the TransformStreamDefaultController interface closes the readable side and errors the writable side of the stream.

Syntax

js
terminate()

Parameters

None.

Return value

None (undefined).

Examples

In the below example the terminate() method is called on a TransformStreamDefaultController.

js
controller.terminate();

Specifications

Specification
Streams
# ts-default-controller-terminate

Browser compatibility