'finish' 与 'end' 事件
'finish'
事件在调用 stream.end()
并且所有块都已被 stream._transform()
处理后触发。
'end'
事件在所有数据输出后触发,该事件发生在调用 transform._flush()
中的回调之后。
The 'finish'
and 'end'
events are from the stream.Writable
and stream.Readable
classes, respectively. The 'finish'
event is emitted
after stream.end()
is called and all chunks have been processed
by stream._transform()
. The 'end'
event is emitted
after all data has been output, which occurs after the callback in
transform._flush()
has been called.