Explain Streams and its types in Node.js?

Streams are one of the fundamental concepts that power Node.js applications.the stream module provides an API for implementing the stream interface.

const Stream=require(‘stream’);

We can write data to Writable streams

fs.createWriteStream()

We can read data from Readable streams

fs.createReadStream()

Duplex Streams are both readable as well as writable.

net.socket.

Transform streams can modify or transform the data as it is written and read.

zlib.createDeflate