Last active
December 12, 2015 08:19
-
-
Save othiym23/4743530 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
(function () { | |
var myfile; | |
function readFileCallback(err, val) { | |
if (err) throw err; | |
myfile=val; | |
console.log('in callback : ' + myfile); | |
} | |
function callbackMaker(callback) { | |
return function(err, vall) { | |
readFileCallback(err, val); | |
callback(); | |
} | |
} | |
(require('fs')).readFile('betazoid.html', | |
callbackMaker(function () { console.log('post callback : ' + myfile); })); | |
}()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment