Created
April 15, 2012 20:29
-
-
Save glennblock/2394695 to your computer and use it in GitHub Desktop.
async exits with streamline
This file contains hidden or 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
//this does not work because exists does not accept a standard callback | |
function createRequiredFilesIfNotPresent(_) { | |
var baseFolder = process.cwd(); | |
var exists = path.exists(baseFolder + "/server.js"); | |
log.info(exists); | |
} | |
//using a wrapper function however works. Log entries added for sequence. | |
function exists(p, callback) { | |
path.exists(p, function(e) { | |
callback(null, e); | |
}); | |
} | |
function createRequiredFilesIfNotPresent(_) { | |
var baseFolder = process.cwd(); | |
log.info("check exists start"); | |
var p1 = exists(baseFolder + "/server.js", _); | |
log.info("exists:" + p1); | |
log.info("check exists complete"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sure. My skype is offline most of the time but I'll turn it on. But that won't be before tomorrow as I'm travelling today.