Skip to content

Instantly share code, notes, and snippets.

@cowboy
Created July 22, 2013 19:15
Show Gist options
  • Save cowboy/6056720 to your computer and use it in GitHub Desktop.
Save cowboy/6056720 to your computer and use it in GitHub Desktop.
Node.js stream pipe question (v0.8.16)
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