Skip to content
This repository has been archived by the owner on Mar 8, 2019. It is now read-only.
/ promise-async Public archive

Adds Promises bindings for async library. Works with callbacks as well.

License

Notifications You must be signed in to change notification settings

Kikobeats/promise-async

Repository files navigation

promise-async

Last version Build Status Dependency status Dev Dependencies Status NPM Status Donate

Adds Promises bindings for async library. Works with callbacks as well.

Install

npm install promise-async --save

If you want to use in the browser (powered by Browserify):

bower install promise-async --save

and later link in your HTML:

<script src="bower_components/promise-async/dist/promise-async.js"></script>

Usage

const async = require('promise-async')

async.waterfall([
  function (callback) {
    callback(null, 'one', 'two')
  },
  function (arg1, arg2, callback) {
    // arg1 now equals 'one' and arg2 now equals 'two'
    callback(null, 'three')
  },
  function (arg1, callback) {
    // arg1 now equals 'three'
    callback(null, 'done')
  }
]).then(function (value) {
  console.log(value === 'done') // => true
})

License

MIT © Kiko Beats

About

Adds Promises bindings for async library. Works with callbacks as well.

Resources

License

Stars

Watchers

Forks

Packages

No packages published