We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1e8625c commit c374648Copy full SHA for c374648
lib/internal/streams/pipeline.js
@@ -188,6 +188,11 @@ function pipeline(...streams) {
188
PassThrough = require('_stream_passthrough');
189
}
190
191
+ // If the last argument to pipeline is not a stream
192
+ // we must create a proxy stream so that pipeline(...)
193
+ // always returns a stream which can be further
194
+ // composed through `.pipe(stream)`.
195
+
196
const pt = new PassThrough();
197
if (isPromise(ret)) {
198
ret
@@ -222,6 +227,9 @@ function pipeline(...streams) {
222
227
223
228
224
229
230
+ // TODO(ronag): Consider returning a Duplex proxy if the first argument
231
+ // is a writable. Would improve composability.
232
+ // See, https://github.com/nodejs/node/issues/32020
225
233
return ret;
226
234
235
0 commit comments