[Pkg-javascript-commits] [node-labeled-stream-splicer] 07/14: Don't include stream sinks in the pipeline [skip ci]

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 15 09:43:53 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-labeled-stream-splicer.

commit 85530cd1b82042b63b1ea871bbceaa9eef8496f0
Author: Terin Stock <terinjokes at gmail.com>
Date:   Mon Nov 17 11:46:47 2014 -0800

    Don't include stream sinks in the pipeline [skip ci]
    
    The documentation shouldn't suggest including stream sinks as part of
    the pipeline, as this leads to incorrect behavior when the included
    stream is a WritableStream.
    
    Instead, the output of a pipeline should be piped to a stream sink.
---
 readme.markdown | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/readme.markdown b/readme.markdown
index 557f5ae..e7c9b0a 100644
--- a/readme.markdown
+++ b/readme.markdown
@@ -15,18 +15,22 @@ var splicer = require('labeled-stream-splicer');
 var through = require('through2');
 var deps = require('module-deps');
 var pack = require('browser-pack');
+var lstream = require('lstream');
 
 var pipeline = splicer.obj([
-    'deps', [ deps(__dirname + '/browser/main.js') ],
-    'pack', [ pack({ raw: true }) ],
-    process.stdout
+    'deps', [ deps() ],
+    'pack', [ pack({ raw: true }) ]
 ]);
 
+pipeline.get('deps').unshift(lstream());
+
 pipeline.get('deps').push(through.obj(function (row, enc, next) {
     row.source = row.source.toUpperCase();
     this.push(row);
     next();
 }));
+
+process.stdin.pipe(pipeline).pipe(process.stdout);
 ```
 
 Here the `deps` sub-pipeline is augmented with a post-transformation that

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-labeled-stream-splicer.git



More information about the Pkg-javascript-commits mailing list