Name some of the events fired by streams.

Technology CommunityCategory: Node.jsName some of the events fired by streams.
VietMX Staff asked 3 years ago

Each type of Stream is an EventEmitter instance and throws several events at different instance of times. For example, some of the commonly used events are:

  • data – This event is fired when there is data is available to read.
  • end – This event is fired when there is no more data to read.
  • error – This event is fired when there is any error receiving or writing data.
  • finish – This event is fired when all data has been flushed to underlying system