Node.js fs readfile() with callback function
readfile()
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);