Closed
Description
- Version: 10.7.0
- Platform: Darwin 17.7.0 / Linux 4.10.0
- Subsystem: stream
const Readable=require('stream').Readable;
function testStream(){
return new Readable({
read(size){
this.push(Buffer.alloc(size));
this.push(null);
}
});
}
console.log('with readable:');
testStream()
.on('readable',() => console.log('readable'))
.on('data',buf => console.log(buf.length))
;
Output:
with readable:
readable
console.log('without readable:');
testStream()
.on('data',buf => console.log(buf.length))
;
Output:
without readable:
16384
Metadata
Metadata
Assignees
Labels
No labels