global-asyncawaitpromise

1.0.3 • Public • Published

global-asyncawaitpromise

One liner to add async/await and promises to your project

Check out asyncawaitpromise for a version that does not use globals

Quickstart

require('global-asyncawaitpromise')

// Now we can use async/await and Promise
const main = async(() => {
  console.log(3)
  await(Promise.delay(1000))
  console.log(2)
  await(Promise.delay(1000))
  console.log(1)
  await(Promise.delay(1000))
  console.log('🚀')
})

main()

Docs

The following objects will be available globally

Why do I need this?

Because callback hell sucks, and it's tedious to have to keep writing this boilerplate

const Promise = require('bluebird')
const async = require('asyncawait/async')
const await = require('asyncawait/await')

/global-asyncawaitpromise/

    Package Sidebar

    Install

    npm i global-asyncawaitpromise

    Weekly Downloads

    3

    Version

    1.0.3

    License

    MIT

    Last publish

    Collaborators

    • dikarel