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

p-all

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

p-all

Run promise-returning & async functions concurrently with optional limited concurrency

  • 5.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.4M
decreased by-12.6%
Maintainers
1
Weekly downloads
 
Created

What is p-all?

The p-all package is a utility module for running multiple promise-returning & async functions with limited concurrency, aggregating the results. It is useful for controlling the execution of a large number of asynchronous operations to ensure that system resources are managed properly.

What are p-all's main functionalities?

Running multiple promises with limited concurrency

This feature allows you to run multiple promises with a specified concurrency limit. In the code sample, three tasks are executed with a concurrency limit of 2, meaning only two promises will be running at the same time.

const pAll = require('p-all');

const tasks = [
  () => Promise.resolve('Task 1'),
  () => Promise.resolve('Task 2'),
  () => Promise.resolve('Task 3')
];

pAll(tasks, { concurrency: 2 }).then(results => {
  console.log(results); // ['Task 1', 'Task 2', 'Task 3']
});

Other packages similar to p-all

Keywords

FAQs

Package last updated on 22 Apr 2023

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