@bonanza/promise-async
Promise bindings for async lib.
Last updated 2 years ago by bonanza .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @bonanza/promise-async 
SYNC missed versions from official npm registry.

promise-async

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 © Bonanza

Current Tags

  • 0.2.0                                ...           latest (2 years ago)

1 Versions

  • 0.2.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 2
Last Month 3
Dependencies (2)
Dev Dependencies (13)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |