Streams are one of the key concepts in Node.js. Streams are a form of data-handling technology that reads or writes input into output in sequence. Streams are used to read/write files and exchange information efficiently.
There are four types of streams in Node.js.
Piping is a method that uses the output of one stream as the input for another. It is typically used to extract data from one stream and pass the output to another stream. There are no restrictions on piping operations.
Chaining is a mechanism for connecting the output of one stream to another, resulting in a chain of several stream actions. It is typically utilized for pipe operations.
Here are some Node APIs that use streams: