Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

run-parallel-limit

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

run-parallel-limit

Run an array of functions in parallel, but limit the number of tasks executing at the same time

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.1M
decreased by-5.51%
Maintainers
1
Weekly downloads
 
Created

What is run-parallel-limit?

The run-parallel-limit npm package allows for the execution of multiple asynchronous tasks in parallel, with a limit on the number of tasks that can run simultaneously. This is particularly useful for managing resource usage and avoiding overloading the system when performing a large number of asynchronous operations, such as file I/O, network requests, or CPU-intensive tasks.

What are run-parallel-limit's main functionalities?

Running multiple tasks in parallel with a limit

This feature allows you to run multiple asynchronous tasks in parallel, but with a specified limit on the number of tasks that can be executed at the same time. In the code sample, two tasks are defined and run with a limit of 1, meaning they will execute one after the other rather than simultaneously.

const runParallelLimit = require('run-parallel-limit');

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

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

Other packages similar to run-parallel-limit

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