Friday, December 16, 2016

Node.js Tutorial for Beginners 12 - Basics of Streams - Writable Streams



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----------------------------------------');
})

Partner Sites

VideoToGifs.com

EasyOnlineConverter.com

SqliteTutorials.com


Stuff I use to make videos

Windows notebook - http://amzn.to/2ADOPrW

Apple MacBook Pro - http://amzn.to/2AC0WG2

Microphone - http://amzn.to/2AC1kV0

notebook mouse - http://amzn.to/2BmeZ2d