Skip to content

Instantly share code, notes, and snippets.

@pyadav
Created August 9, 2015 08:28
Show Gist options
  • Save pyadav/b9f106caf89523a5c7ce to your computer and use it in GitHub Desktop.
Save pyadav/b9f106caf89523a5c7ce to your computer and use it in GitHub Desktop.
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