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

promise-map-series

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

promise-map-series

Map over array avoiding parallel execution, using promises

  • 0.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
840K
increased by17.63%
Maintainers
1
Weekly downloads
 
Created
Source

promise-map-series

Build Status

Call an iterator function for each element of an array in series, ensuring that no iterator is called before the promise returned by the previous iterator is fulfilled, in effect preventing parallel execution. Like async.mapSeries, but for promises.

Installation

npm install --save promise-map-series

Usage

var mapSeries = require('promise-map-series')

mapSeries(array, iterator[, thisArg]).then(function (newArray) {
  ...
})
  • array: An array of values (should not be promises).

  • iterator: Function that returns a promise or a value for the new array. The iterator will be called once for each element. If iterator returns a promise, then iterator will only be called for the next element once that promise is fulfilled. If the promise is rejected or iterator throws an error, iteration will stop immediately and mapSeries returns a rejected promise. The iterator function receives three arguments:

    • item: The current item in the array.

    • index: The current index in the array.

    • array: The original array argument.

  • thisArg (optional): Value to use as this when executing iterator.

FAQs

Package last updated on 20 Dec 2019

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