Archive for the 'node.js' Category

 

node.js learning with learnyounode .. solutions ..

May 08, 2015 in javascript, node.js

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]