node package manager
Painless code sharing. npm Orgs help your team discover, share, and reuse code. Create a free org »

foyer

foyer

NPM version build status Test coverage

Execute async functions in parallel and trigger a callback when done.

Installation

$ npm i --save foyer

Example

var foyer = require('foyer');

function callback(err, res) {
  return res;
  // => ['myRes2', 'myRes']
}

foyer([
  function(done) {setTimeout(function(){end('myError', 'myRes');}, 10)}, 
  function(done) {end('myError2', 'myRes2')}
], callback);

API

foyer([functions], callback)

var tasks = [
  function(done){done(null, 'hello')}, 
  function(done){done(null, 'world')}
];
var cb = function(err, res){return res};

foyer(tasks, cb);
// => ['hello', 'world']

License

MIT © Yoshua Wuyts