@mafintosh said most of this, I just wrote it down
- usually you call
.destroy()
if it has.destroy
- if it doesnt have
.destroy
you are out of luck and the stream should upgrade to use e.g. newerthrough2
- in request you call
.abort()
(this should get fixed to use.destroy()
) .end()
tries to end the stream gracefully
- usually no
.close
method exists except in FD backed streams (usually onlyfs
). usually you would never call.close()
finish
event is emitted when a stream ends nicely (e.g.stream.end()
)close
anderror
events are emitted when a stream ends due to failure (e.g.stream.destroy()
)end
is emitted when a readable stream has no more dataend
in streams2 behaves more like a flush event, it only gets emitted when the data has been read from the readable
The
close
event does not indicate failure in any usage I've ever seen.