Author: techfox9

node.js learning with learnyounode .. solutions ..

Friday, May 8th, 2015 @ 1:03 am

Exercise 4, asynchronous (async) file processing ..

From: https://github.com/JeffPaine/learnyounode-solutions

[js]

var countLines = function (err, fileBuffer){
// console.log(fileBuffer);
console.log(fileBuffer.split(‘\n’).length);
};

fs.readFile(process.argv[2], ‘utf8’, countLines);

[/js]

javascript, node.js


 


Comments are closed.