Skip to content

Commit a3108ff

Browse files
authored
doc: document TransformStream transformer.cancel option
Add documentation for the `cancel` option of the `TransformStream` transformer, which allows users to specify a callback that will be called when the stream is canceled. See: https://streams.spec.whatwg.org/#transformer-api Fixes: nodejs/node#62540 PR-URL: nodejs/node#62566 Fixes: nodejs/node#62540 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 4b3d82c commit a3108ff

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

doc/api/webstreams.md

Lines changed: 11 additions & 0 deletions
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

0 commit comments

Comments
 (0)