4
var fs = require("fs");

var readStream= fs.createReadStream('input.txt');

var writeStream=fs.createWriteStream('output.txt');

readStream.pipe(writeStream);

console.log("hello...world");

In the above program, readStream and writeStream operations are done by pipe function..what was the internal code and internal process happening in the pipe()?

M. Adeel Khalid
  • 1,786
  • 2
  • 21
  • 24
Krishna Mohan
  • 159
  • 1
  • 11

1 Answers1

0

piping will performs like a bridge in nodejs. review here: https://nodejs.org/api/stream.html#stream_event_pipe

Ram MVS
  • 9
  • 4