| Node.js Piping Stream
Node.js Piping Stream
When we say about the Piping stream, it is a mechanism where output of any one stream is used as input for another stream. And there is no limit on piping operation.
To understand this we will take a piping example for reading from one file and writing to another file.
Create a text file named input.txt having the following content:
File: main.js
Now open Node.js in command prompt and run the command main.js
node main.js
Now after the above running command we will open file "output.txt" which is created and we saved as main.js. And once we done that we get on the desktop.
And after opening the "output.txt" file we will get the below content.
| | |