Created
April 11, 2020 09:14
-
-
Save Mayankgupta688/e5759253125b9d89b9f6c9682b5c99d0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
var readableStream = fs.createReadStream('largeFile.html'); | |
var writableStream = fs.createWriteStream('copiedFile.html'); | |
readableStream.setEncoding('utf8'); | |
readableStream.on('data', function(chunk) { | |
writableStream.write(chunk); | |
}); | |
readableStream.on('end', function(chunk) { | |
console.log("File Content Copied...") | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment