New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

promise-quene

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

promise-quene

Provide a current-limiting Promise queue for solving multiple Promise concurrency.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

PromiseQuene

Summary

Provide a current-limiting Promise queue for solving multiple Promise concurrency.

Main scene:

  • Large file downloads need to control the number of concurrent download tasks

How to use?

install by npm:

npm i promise-quene

example:

const PromiseQuene = require('promise-quene');
const pq = new PromiseQuene({
  concurrency:3 // you can set the max concurrency number
});

[1,2,3,4,5].forEach((v)=>{
  pq.add(()=>new Promise((resolve)=>{
    // you can do something async
    setTimeout(()=>{
      console.log(v);
      resolve();
    },1000);
  }))
});

FAQs

Package last updated on 29 Dec 2020

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