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

limited-map

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

limited-map

Async map function with limited concurrency

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-60%
Maintainers
1
Weekly downloads
 
Created
Source

limited-map

Async map function with limited concurrency for JavaScript. This is a replacement for Promise.all(items.map(asyncCallback)). For example, this is useful if you have an API that you don't want to overload with your request flood.

Example

const limitedMap = require("limited-map");

async function fetchDocs() {
  const docs = await limitedMap(urls, url => getJSON(url), 30);
  return docs;
}

API

limitedMap<T, U>(
  items: Array<T>, 
  callback: (item: T, index: number, array: Array<T>) => Promise<U>, 
  concurrency: number
): Promise<Array<U>>

License

MIT

FAQs

Package last updated on 30 Apr 2018

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