Created
July 29, 2014 05:40
-
-
Save iarna/78aebb51f31cce7cd49b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var stream = require('stream'); | |
var DuplexCombination = require('duplex-combination'); | |
function dosomething() { | |
var input = new stream.PassThrough(); | |
var output = new stream.PassThrough(); | |
var combined = new DuplexCombination(output,input) | |
output.write('two'); | |
input.pipe(output); | |
return combined; | |
} | |
var source = new stream.PassThrough() | |
source.pipe(dosomething()).pipe(process.stdout) | |
source.write('one') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment