Created
July 22, 2013 19:15
-
-
Save cowboy/6056720 to your computer and use it in GitHub Desktop.
Node.js stream pipe question (v0.8.16)
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 a = new Stream; | |
a.pipe(process.stdout); | |
a.emit('data', 'omg test 123\n'); | |
// logs: omg test 123 | |
var b = new Stream; | |
b.pipe(a); | |
b.emit('data', 'omg test 456\n'); | |
// logs nothing. What am I doing wrong? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment