var stream = require("stream");
var rstream = (function() {
var i = 0;
var rstream = new stream.Readable();
rstream._read = function(){
return this.push(++i > 2 ? "" : ["hello","world"][i-1]);
};
return rstream
})();
var wstream = new stream.Writable();
wstream._write = function(chunk, enc, next){
console.log("w", chunk.toString());
return next();
};
rstream.pipe(wstream);