Installations
npm install p-map-series
Developer Guide
Typescript
No
Module System
ESM
Min. Node Version
>=12
Node Version
15.12.0
NPM Version
6.14.10
Releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (70.34%)
TypeScript (29.66%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
sindresorhus
Download Statistics
Total Downloads
540,564,205
Last Day
332,628
Last Week
1,495,317
Last Month
6,660,298
Last Year
92,598,911
GitHub Statistics
48 Stars
11 Commits
4 Forks
7 Watching
1 Branches
3 Contributors
Bundle Size
299.00 B
Minified
211.00 B
Minified + Gzipped
Sponsor this package
Package Meta Information
Latest Version
3.0.0
Package Id
p-map-series@3.0.0
Size
2.42 kB
NPM Version
6.14.10
Node Version
15.12.0
Publised On
09 Apr 2021
Total Downloads
Cumulative downloads
Total Downloads
540,564,205
Last day
-5.5%
332,628
Compared to previous day
Last week
-13.8%
1,495,317
Compared to previous week
Last month
-0.1%
6,660,298
Compared to previous month
Last year
-10.6%
92,598,911
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
p-map-series
Map over promises serially
Useful as a side-effect mapper. Use p-map
if you don't need side-effects, as it's concurrent.
Install
$ npm install p-map-series
Usage
1import pMapSeries from 'p-map-series'; 2 3const keywords = [ 4 getTopKeyword() //=> Promise 5 'rainbow', 6 'pony' 7]; 8 9let scores = []; 10 11const mapper = async keyword => { 12 const score = await fetchScore(keyword); 13 scores.push(score); 14 return {keyword, score}; 15}); 16 17console.log(await pMapSeries(keywords, mapper)); 18/* 19[ 20 { 21 keyword: 'unicorn', 22 score: 99 23 }, 24 { 25 keyword: 'rainbow', 26 score: 70 27 }, 28 { 29 keyword: 'pony', 30 score: 79 31 } 32] 33*/
API
pMapSeries(input, mapper)
Returns a Promise
that is fulfilled when all promises in input
and ones returned from mapper
are fulfilled, or rejects if any of the promises reject. The fulfilled value is an Array
of the mapper
created promises fulfillment values.
input
Type: Iterable<Promise | unknown>
Mapped over serially in the mapper
function.
mapper(element, index)
Type: Function
Expected to return a value. If it's a Promise
, it's awaited before continuing with the next iteration.
Related
- p-each-series - Iterate over promises serially
- p-reduce - Reduce a list of values using promises into a promise for a value
- p-map - Map over promises concurrently
- More…
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.
![Empty State](/_next/static/media/empty.e5fae2e5.png)
No vulnerabilities found.
Reason
security policy file detected
Details
- Info: security policy file detected: .github/security.md:1
- Info: Found linked content: .github/security.md:1
- Info: Found disclosure, vulnerability, and/or timelines in security policy: .github/security.md:1
- Info: Found text in security policy: .github/security.md:1
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: license:0
- Info: FSF or OSI recognized license: MIT License: license:0
Reason
Found 3/11 approved changesets -- score normalized to 2
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/sindresorhus/p-map-series/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/sindresorhus/p-map-series/main.yml/main?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/main.yml:21
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 npmCommand dependencies pinned
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/main.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'main'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 3 are checked with a SAST tool
Score
4.2
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to p-map-series
@types/p-map-series
Stub TypeScript definitions entry for p-map-series, which provides its own types definitions
@tunnckocore/p-all
Map or loop through promises, promise-returning or async functions, serially or in parallel, based on Promise.all! Has a hooks system: start, beforeEach, afterEach, finish.
p-saga
expand promise static methods