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.

Revisions

  1. raphael-shin created this gist Mar 2, 2016.
    11 changes: 11 additions & 0 deletions defer-sample1.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    var fs = require(“fs”);

    var asyncFunction = function(callback) {
    fs.exists(./sample.file”, function (exists) {
    callback(exists);
    });
    }

    asyncFunction(function(result) {
    console.log(result);
    });