JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 52288782
  • Score
    100M100P100Q226912F
  • License MIT

Run an array of functions in parallel

Package Exports

  • run-parallel

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (run-parallel) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

run-parallel travis npm gittip

Run an array of functions in parallel

browser support parallel

install

npm install run-parallel

usage

parallel(tasks, [callback])

Run the tasks array of functions in parallel, without waiting until the previous function has completed. If any of the functions pass an error to its callback, the main callback is immediately called with the value of the error. Once the tasks have completed, the results are passed to the final callback as an array.

var parallel = require('run-parallel')

parallel([
  function (callback) {
      setTimeout(function () {
          callback(null, 'one')
      }, 200)
  },
  function (callback) {
      setTimeout(function () {
          callback(null, 'two')
      }, 100)
  }
],
// optional callback
function (err, results) {
    // the results array will equal ['one','two'] even though
    // the second function had a shorter timeout.
})

This module is basically equavalent to async.parallel, but it's handy to just have the one function you need instead of the kitchen sink. Modularity! Especially handy if you're serving to the browser and need to reduce your javascript bundle size.

Works great in the browser with browserify!

license

MIT. Copyright (c) Feross Aboukhadijeh.