◐ Shell
clean mode source ↗

doc: document TransformStream transformer.cancel option · nodejs/node@736ed8a

Original file line numberDiff line numberDiff line change

@@ -1148,6 +1148,12 @@ await Promise.all([

11481148
11491149

<!-- YAML

11501150

added: v16.5.0

1151+

changes:

1152+

- version:

1153+

- v21.5.0

1154+

- v20.14.0

1155+

pr-url: https://github.com/nodejs/node/pull/50126

1156+

description: Supports the `cancel` transformer callback.

11511157

-->

11521158
11531159

* `transformer` {Object}

@@ -1166,6 +1172,11 @@ added: v16.5.0

11661172

the transformation process.

11671173

* `controller` {TransformStreamDefaultController}

11681174

* Returns: A promise fulfilled with `undefined`.

1175+

* `cancel` {Function} A user-defined function that is called when either the

1176+

readable side of the `TransformStream` is canceled or the writable side is

1177+

aborted.

1178+

* `reason` {any}

1179+

* Returns: A promise fulfilled with `undefined`.

11691180

* `readableType` {any} the `readableType` option is reserved for future use

11701181

and _must_ be `undefined`.

11711182

* `writableType` {any} the `writableType` option is reserved for future use