async-bluebird

1.0.4 • Public • Published

async-bluebird

npm version Build Status

A bluebird promisified wrap of async - async utitlities for node and the browser.

I made this because I felt like it's more productive than manually wrapping async functions with Promises every time I want to use them.

Install & Require:

  • npm i async-bluebird
// Promisified async & bluebird Promises
var {async, Promise} = require('async-bluebird');
 
// Just Promisified async
var async = require('async-bluebird');

Usage:

Example

// With callback:
async.each([1,2,3], (item, callback) => {
  // Callback on each item
}, (err) => {
  if (err) {
    // Handle error
  } else {
    // Success
  }
})
 
// With Promise:
async.each([1,2,3], (item, callback) => {
  // Callback on each item
}).then(() => {
  // Success
}).catch((err) => {
  // Handle error
});

Why use Promises?

Converting async's utility functions into Promises allows us to easily integrate them with our promise-using code and promise-chains.

Package Sidebar

Install

npm i async-bluebird

Weekly Downloads

1

Version

1.0.4

License

MIT

Unpacked Size

221 kB

Total Files

51

Last publish

Collaborators

  • gfjhogue