The ‘pipe’ event is emitted when the stream.pipe() method is called on a readable stream, adding this writable to its set of destinations.
All Readable streams begin in paused mode but can be switched to flowing mode in one of the following ways:
Adding a ‘data’ event handler.
Calling the stream.resume() method.
Calling the stream.pipe() method to send the data to a Writable.
The Readable can switch back to paused mode using one of the following:
If there are no pipe destinations, by calling the stream.pause() method.
If there are pipe destinations, by removing any ‘data’ event handlers, and removing all pipe destinations by calling the stream.unpipe() method.