var fs = require('fs'); var readStream = fs.createReadStream('file.txt'); readStream.setEncoding('utf8'); var writeStream = fs.createWriteStream('write_file.txt'); readStream.on('data', function(chunk) { console.log('------------------------------------------------------------'); writeStream.write(chunk); }) readStream.on('end', function(chunk) { console.log('--------------------End----------------------------------------'); })
Node.Js Tutorial For Beginners 12 - Basics Of Streams - Writable Streams
Posted by Hold
on February 04, 2017
0 comments:
Post a Comment