NodeJS Stream Pipeline
const { pipeline } = require('stream');
let readStream = fs.createReadStream("./myDataInput.txt");
let writeStream = fs.createWriteStream("./myDataOutput.txt");
pipeline(readStream, writeStream, error => {
if (error) {
console.error(error);
} else {
console.info("Pipeline Successful")
}
});
Muhammad Abdullah