Socket
Socket
Sign inDemoInstall

run-parallel

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

run-parallel

Run an array of functions in parallel


Version published
Weekly downloads
36M
decreased by-6.7%
Maintainers
1
Weekly downloads
 
Created

What is run-parallel?

The run-parallel npm package is designed to run multiple functions in parallel, without waiting until the previous function has completed. It is particularly useful for executing asynchronous tasks concurrently, such as I/O operations, in an efficient manner. Once all tasks have completed, a final callback is called with the results of each task.

What are run-parallel's main functionalities?

Running multiple asynchronous tasks in parallel

This feature allows for executing multiple asynchronous tasks concurrently. The code sample demonstrates how to use run-parallel to execute two tasks in parallel, each completing at different times but being processed together.

const runParallel = require('run-parallel')

const tasks = [
  function(callback) {
    setTimeout(function() {
      callback(null, 'one')
    }, 200)
  },
  function(callback) {
    setTimeout(function() {
      callback(null, 'two')
    }, 100)
  }
]

runParallel(tasks, function(err, results) {
  console.log(results) // ['one', 'two']
})

Other packages similar to run-parallel

Keywords

FAQs

Package last updated on 10 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc