Node.js fs readfile() with callback function

Description

Node.js fs readfile() with callback function

var fs = require('fs');
var onFileLoad = function(err,file){
  console.log("got the file");
}
console.log(1);/* w w  w.ja va  2 s. c  o m*/

fs.readFile('./main.js', onFileLoad);

console.log(3);



PreviousNext

Related