Created
August 9, 2015 08:28
-
-
Save pyadav/b9f106caf89523a5c7ce 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
var promisify = require("promisify-node"); | |
function makeItAsync(callback) { | |
callback(null, true); | |
} | |
// Convert the function to return a Promise. | |
var wrap = promisify(makeItAsync); | |
// Invoke the newly wrapped function. | |
wrap().then(function(value) { | |
console.log(value === true); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment