//read text file and print contents in node js fs.readFile('index.js', 'utf8',(err, contents) => console.log(contents)) //read stream and print contents fs.createReadStream('index.js', {encoding: 'utf8'}) .on('data', (chunk) => console.log(chunk)) .on('end', (chunk) => console.log('end of file!')) //watch files for changes var fs = require('fs'); var files = fs.readdirSync(process.cwd()); files.forEach(function(file){ fs.watchFile(process.cwd() + '/' + file, () => { console.log(' - ' + file + ' changed!'); }); });