Skip to content

Commit 80fa675

Browse files
aloisklinktargos
authored andcommitted
doc: document pipeline with end option
There is currently no documentation about what the `end` option in `stream.promises.pipeline` does. Refs: #40886 Refs: #34805 (comment) Fixes: #45821 PR-URL: #48970 Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 5469adf commit 80fa675

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

doc/api/stream.md

+13-2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,15 @@ or `require('node:stream').promises`.
6565

6666
<!-- YAML
6767
added: v15.0.0
68+
changes:
69+
- version:
70+
- v18.0.0
71+
- v17.2.0
72+
- v16.14.0
73+
pr-url: https://github.com/nodejs/node/pull/40886
74+
description: Add the `end` option, which can be set to `false` to prevent
75+
automatically closing the destination stream when the source
76+
ends.
6877
-->
6978

7079
* `streams` {Stream\[]|Iterable\[]|AsyncIterable\[]|Function\[]}
@@ -76,9 +85,11 @@ added: v15.0.0
7685
* `destination` {Stream|Function}
7786
* `source` {AsyncIterable}
7887
* Returns: {Promise|AsyncIterable}
79-
* `options` {Object}
88+
* `options` {Object} Pipeline options
8089
* `signal` {AbortSignal}
81-
* `end` {boolean}
90+
* `end` {boolean} End the destination stream when the source stream ends.
91+
Transform streams are always ended, even if this value is `false`.
92+
**Default:** `true`.
8293
* Returns: {Promise} Fulfills when the pipeline is complete.
8394

8495
```cjs

0 commit comments

Comments
 (0)