@seedalpha/parallel

Execute multiple async functions in parallel and get back ordered array of results

Usage no npm install needed!

<script type="module">
  import seedalphaParallel from 'https://cdn.skypack.dev/@seedalpha/parallel';
</script>

README

parallel

Execute multiple async functions in parallel and get back ordered array of results

Installation

$ npm install seed-parallel --save

Usage

var parallel = require('seed-parallel');

function a(cb) {
  cb(null, 'a');
}

function b(cb) {
  setTimeout(cb, 1000, null, 'b');
}

function c(cb) {
  process.nextTick(function() {
    cb(null, 'c');
  });
}

parallel(a, b, c, function(err, results) {
  console.log(err, results); // null, ['a', 'b', 'c']
});

Development

$ git clone git@github.com:seedalpha/parallel.git
$ cd parallel
$ npm install
$ npm test

Author

Vladimir Popov vlad@seedalpha.net

License

MIT