Streams are pipelines that read or write data from a source and transfer it to a continuous flow destination. There are four types of streams:
- Readable
- Writable
- Duplex (both readable and writable)
- Transform (A type of duplex stream. Its output is calculated using the input)
Each stream is also an EventEmitter
. It means a stream object can emit events when there is no data on the stream, when data is available on the stream, or when data in the stream is flushed from the program.