readable.push('')


不建议使用 readable.push('')

【Use of readable.push('') is not recommended.】

向不处于对象模式的流推送一个零字节的 <string><Buffer><TypedArray><DataView> 会产生一个有趣的副作用。因为这本质上是对 readable.push() 的一次调用,该调用将结束读取过程。然而,由于参数是一个空字符串,可读缓冲区中不会添加任何数据,因此用户无法消费任何内容。

【Pushing a zero-byte <string>, <Buffer>, <TypedArray> or <DataView> to a stream that is not in object mode has an interesting side effect. Because it is a call to readable.push(), the call will end the reading process. However, because the argument is an empty string, no data is added to the readable buffer so there is nothing for a user to consume.】