574 Views
When a newcomer to Node.js first writes a file reading program, it comes out something like this. var fs = require('fs'); var fileContents; fs.readFile(filename, utf8, function(err, data) { fileContents = data; }); while (!fileContents) { // wait until the file contents is filled } // then print the
0 comments