@mafintosh said most of this, I just wrote it down
- usually you call
.destroy()if it has.destroy - if it doesnt have
.destroyyou 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
.closemethod exists except in FD backed streams (usually onlyfs). usually you would never call.close()
finishevent is emitted when a stream ends nicely (e.g.stream.end())closeanderrorevents are emitted when a stream ends due to failure (e.g.stream.destroy())endis emitted when a readable stream has no more dataendin streams2 behaves more like a flush event, it only gets emitted when the data has been read from the readable
The
closeevent does not indicate failure in any usage I've ever seen.