Skip to content

Commit

Permalink
doc: document pipeline with end option
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
aloisklink authored and targos committed May 12, 2024
1 parent 5469adf commit 80fa675
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions doc/api/stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ or `require('node:stream').promises`.

<!-- YAML
added: v15.0.0
changes:
- version:
- v18.0.0
- v17.2.0
- v16.14.0
pr-url: https://github.com/nodejs/node/pull/40886
description: Add the `end` option, which can be set to `false` to prevent
automatically closing the destination stream when the source
ends.
-->

* `streams` {Stream\[]|Iterable\[]|AsyncIterable\[]|Function\[]}
Expand All @@ -76,9 +85,11 @@ added: v15.0.0
* `destination` {Stream|Function}
* `source` {AsyncIterable}
* Returns: {Promise|AsyncIterable}
* `options` {Object}
* `options` {Object} Pipeline options
* `signal` {AbortSignal}
* `end` {boolean}
* `end` {boolean} End the destination stream when the source stream ends.
Transform streams are always ended, even if this value is `false`.
**Default:** `true`.
* Returns: {Promise} Fulfills when the pipeline is complete.

```cjs
Expand Down

0 comments on commit 80fa675

Please sign in to comment.