
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
p-map-series
Advanced tools
Map over promises serially
Useful as a side-effect mapper. Use p-map if you don't need side-effects, as it's concurrent.
$ npm install p-map-series
import pMapSeries from 'p-map-series';
const keywords = [
getTopKeyword() //=> Promise
'rainbow',
'pony'
];
let scores = [];
const mapper = async keyword => {
const score = await fetchScore(keyword);
scores.push(score);
return {keyword, score};
});
console.log(await pMapSeries(keywords, mapper));
/*
[
{
keyword: 'unicorn',
score: 99
},
{
keyword: 'rainbow',
score: 70
},
{
keyword: 'pony',
score: 79
}
]
*/
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.
Type: Iterable<Promise | unknown>
Mapped over serially in the mapper function.
Type: Function
Expected to return a value. If it's a Promise, it's awaited before continuing with the next iteration.
The p-series package allows you to run promise-returning & async functions in series. It is similar to p-map-series but focuses solely on running promises in sequence without the mapping functionality.
The promise-sequential package runs an array of promise-returning functions sequentially. It is similar to p-map-series but is designed to be lightweight and straightforward, focusing solely on sequential execution.
FAQs
Map over promises serially
The npm package p-map-series receives a total of 1,900,777 weekly downloads. As such, p-map-series popularity was classified as popular.
We found that p-map-series demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.