foy

foyer

Execute async functions in parallel and trigger a callback when done

Showing:

Popularity

Downloads/wk

0

GitHub Stars

2

Maintenance

Last Commit

7yrs ago

Contributors

1

Package

Dependencies

0

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

foyer

NPM version build status Test coverage

Execute async functions in parallel and trigger a callback when done. Sets the context of the executed functions to itself.

Installation

$ npm i --save foyer

Example

var foyer = require('foyer');

foyer([
  function(done) {setTimeout(function(){done('myError', 'myRes');}, 10)},
  function(done) {done('myError2', 'myRes2')}
], function callback(err, res) {return res;});
// => ['myRes2', 'myRes']

API

foyer([functions], callback)

// Define an array of async functions.
var tasks = [
  function(done){done(null, 'hello')},
  function(done){done(null, 'world')}
];

// Define the callback to be executed
var cb = function(err, res){return res};

// Run 'Foyer' to execute your tasks and run the callback when finished
foyer(tasks, cb);
// => ['hello', 'world']

License

MIT © Yoshua Wuyts

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial