This document defines the behaviour that a Stream
must implement in order to be compatible with Stream#pipe
. This is not an official document, but is intended as a guide to produce correct behaviour in user-land streams.
All streams must emit 'error'
if writing to or reading from becomes physically impossible. 'error'
implys that the stream has ended.
All streams may emit 'close'
. 'close'
means that any underlying resources have been disposed of. If a ReadableStream
has ended normally, it must not emit 'close'
before 'end'
.