unless you want to undocument it, .read(0) for me is "start getting data from the underlying source but don't consume this stream yet". thus, it shouldn't emit end until .read(n) is called with anything but n === 0.
test case:
var stream = new (require('stream')).Readable
stream.on('end', function () { console.log('end')})
stream._read = function(){}
stream.push(null)
stream.read(0)
// `end` is emitted but should not
stream.read()
// now `end` should be emitted
unless you want to undocument it,
.read(0)for me is "start getting data from the underlying source but don't consume this stream yet". thus, it shouldn't emitenduntil.read(n)is called with anything butn === 0.test case: