选择一种 API 风格
【Choose one API style】
Readable 流 API 在多个 Node.js 版本中不断发展,提供了多种消费流数据的方法。通常,开发者应选择一种数据消费方法,并且绝不应同时使用多种方法从单个流中读取数据。具体来说,结合使用 on('data')、on('readable')、pipe() 或异步迭代器可能会导致不可预期的行为。
【The Readable stream API evolved across multiple Node.js versions and provides
multiple methods of consuming stream data. In general, developers should choose
one of the methods of consuming data and should never use multiple methods
to consume data from a single stream. Specifically, using a combination
of on('data'), on('readable'), pipe(), or async iterators could
lead to unintuitive behavior.】