Streams in Node.js

  • Post category:Node
  • Reading time:1 mins read

Use of streams:

It will fix the problem of backpressure that means it will automatically handle the speed of data coming in and the data going out.

Streams in Node

const fs = require("fs");
const server = require("http").createServer();

server.on("request", (req, res) => {
    const readableSource = fs.createReadStream("myFile.txt");

server.listen(8000, "", () => {


Share this