Use Streams in Node.js | Create Readable & Writable Streams in Node JS

preview_player
Показать описание
#stubborndevelopers

Readable − Which is used for a read operation.

Writable − Which is used for a write operation.

Duplex − Which can be used for both reading and write operation.

Transform − A type of duplex stream where the output is computed based on input.

Each type of Stream is an EventEmitter instance and throws several events at a 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 an error receiving or writing data.

finish − This event is fired when all the data has been flushed to the underlying system

//Require fs module
const fs = require("fs");

//Create writable stream

//Create readable stream

************ Node.JS Tutorial in English 2021 Playlist ************

************ React.JS Tutorial in Hindi 2021 Playlist ************
Рекомендации по теме
Комментарии
Автор

How to read the image file in chunks ???

usmanshahid
Автор

Sir kya aap hume hindi me nhi pda skte

computerknowledge
visit shbcf.ru