Closed
Description
1.txt 内容为123456789,
代码:
const rs = fs.createReadStream(path.join(__dirname, './1.txt'), {
highWaterMark: 3,
encoding: 'utf8'
})
rs.on('readable', () => {
let ch = rs.read(1)
console.log('ch', ch);
})
9.11版本node 输出 ch 1(readable触发了1次)
10.14.2版本 输出 ch 1 ch 2 (readable触发了2次)
不太懂 readable 什么情况下会再次触发,