• src {stream.Readable} 要[移除][stream.unpipe()]可写流管道的来源流。

    在可读流上调用 [stream.unpipe()] 方法时会发出 'unpipe'事件,从其目标集中移除此可写流。

    当可读流通过管道流向可写流发生错误时,也会触发此事件。

    1. const writer = getWritableStreamSomehow();
    2. const reader = getReadableStreamSomehow();
    3. writer.on('unpipe', (src) => {
    4. console.log('已移除可写流管道');
    5. assert.equal(src, reader);
    6. });
    7. reader.pipe(writer);
    8. reader.unpipe(writer);