Skip to content

Instantly share code, notes, and snippets.

@AliSawari
Created June 4, 2019 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AliSawari/830b15351d5ae3ca8006e25159d0dcce to your computer and use it in GitHub Desktop.
Save AliSawari/830b15351d5ae3ca8006e25159d0dcce to your computer and use it in GitHub Desktop.
example
// import it!
const { promisify } = require("util")
// turn your ordinary func into a promise func!
const doublePromise = promisify(double)
// use it!
doublePromise(14).then(res => {
console.log(res)
}).catch(err => console.log(err))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment