summaryrefslogtreecommitdiff
path: root/doc/api/stream.md
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2018-05-31 12:11:22 +0200
committerAnna Henningsen <anna@addaleax.net>2018-06-08 01:24:39 +0200
commit32c51f10d33c686f2607559ff24a97d6c4a6f109 (patch)
tree0563de6d86fbebc4d9de2c461f645f2f3a8e4989 /doc/api/stream.md
parent505bfdc7e4fc4f914ceca019706dbf06901dd361 (diff)
downloadandroid-node-v8-32c51f10d33c686f2607559ff24a97d6c4a6f109.tar.gz
android-node-v8-32c51f10d33c686f2607559ff24a97d6c4a6f109.tar.bz2
android-node-v8-32c51f10d33c686f2607559ff24a97d6c4a6f109.zip
stream: make the pipeline callback mandatory
Right now when not adding a callback to the pipeline it could cause an uncaught exception if there is an error. Instead, just make the callback mandatory as mostly done in all other Node.js callback APIs so users explicitly have to decide what to do in such situations. PR-URL: https://github.com/nodejs/node/pull/21054 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'doc/api/stream.md')
-rw-r--r--doc/api/stream.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/api/stream.md b/doc/api/stream.md
index 014b2f68b3..09ff2c02b1 100644
--- a/doc/api/stream.md
+++ b/doc/api/stream.md
@@ -1340,14 +1340,14 @@ run().catch(console.error);
rs.resume(); // drain the stream
```
-### stream.pipeline(...streams[, callback])
+### stream.pipeline(...streams, callback)
<!-- YAML
added: v10.0.0
-->
* `...streams` {Stream} Two or more streams to pipe between.
-* `callback` {Function} A callback function that takes an optional error
- argument.
+* `callback` {Function} Called when the pipeline is fully done.
+ * `err` {Error}
A module method to pipe between streams forwarding errors and properly cleaning
up and provide a callback when the pipeline is complete.