为什么我的代码输出总是第一行不显示?
var Readable = require('stream').Readable;
var Writable = require('stream').Writable;
// 实例化
var readStream = new Readable();
var writStream = new Writable();
readStream.push('Hello ');
readStream.push('I ');
readStream.push('Love ');
readStream.push("Scott's ");
readStream.push('lessons\n');
readStream.push(null); // 代表push结束
writStream._write = function(chunk, encode, cb)
{
console.log(chunk.toString());
cb();
}
readStream.pipe(writStream);