Skip to content

Instantly share code, notes, and snippets.

@raphael-shin
Created March 2, 2016 11:05
Show Gist options
  • Select an option

  • Save raphael-shin/303d7f07cfacb3a42eb6 to your computer and use it in GitHub Desktop.

Select an option

Save raphael-shin/303d7f07cfacb3a42eb6 to your computer and use it in GitHub Desktop.
var fs = require(“fs”);
var asyncFunction = function(callback) {
fs.exists(“./sample.file”, function (exists) {
callback(exists);
});
}
asyncFunction(function(result) {
console.log(result);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment