事件:'unpipe'


\Event: 'unpipe'

新增于: v0.9.4

当在 Readable 流上调用 stream.unpipe() 方法时,则会触发 'unpipe' 事件,从其目标集合中删除此 Writable

\The 'unpipe' event is emitted when the stream.unpipe() method is called on a Readable stream, removing this Writable from its set of destinations.

Readable 流管道进入它时,如果此 Writable 流触发错误,则这也会触发。

\This is also emitted in case this Writable stream emits an error when a Readable stream pipes into it.

const writer = getWritableStreamSomehow();
const reader = getReadableStreamSomehow();
writer.on('unpipe', (src) => {
 console.log('Something has stopped piping into the writer.');
 assert.equal(src, reader);
});
reader.pipe(writer);
reader.unpipe(writer); 

AltStyle によって変換されたページ (->オリジナル) /