Installations
npm install p-series
Developer Guide
Typescript
No
Module System
ESM
Min. Node Version
^12.20.0 || ^14.13.1 || >=16.0.0
Node Version
12.22.1
NPM Version
7.10.0
Releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (74.46%)
TypeScript (25.54%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
sindresorhus
Download Statistics
Total Downloads
11,753,620
Last Day
7,356
Last Week
7,356
Last Month
124,615
Last Year
1,785,597
GitHub Statistics
66 Stars
14 Commits
2 Forks
6 Watching
1 Branches
4 Contributors
Bundle Size
403.00 B
Minified
274.00 B
Minified + Gzipped
Sponsor this package
Package Meta Information
Latest Version
3.0.0
Package Id
p-series@3.0.0
Size
2.07 kB
NPM Version
7.10.0
Node Version
12.22.1
Publised On
12 Aug 2021
Total Downloads
Cumulative downloads
Total Downloads
11,753,620
Last day
0%
7,356
Compared to previous day
Last week
-69.7%
7,356
Compared to previous week
Last month
16.1%
124,615
Compared to previous month
Last year
14.7%
1,785,597
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
p-series
Run promise-returning & async functions in series
Note: You can just use await
in a for-loop to get the same behavior. This package was useful before async/await existed.
If you're doing the same work in each function, use p-each-series
instead.
See p-all
for a concurrent counterpart.
Install
$ npm install p-series
Usage
1import pSeries from 'p-series'; 2import got from 'got'; 3 4const tasks = [ 5 () => got('https://sindresorhus.com'), 6 () => checkSomething(), 7 () => doSomethingElse() 8]; 9 10console.log(await pSeries(tasks));
API
pSeries(tasks)
Returns a Promise
that is fulfilled when all promises returned from calling the functions in tasks
are fulfilled, or rejects if any of the promises reject. The fulfilled value is an Array
of the fulfilled values.
tasks
Type: Iterable<Function>
Functions are expected to return a value. If a Promise is returned, it's awaited before continuing with the next task.
Related
- p-all - Run promise-returning & async functions concurrently with optional limited concurrency
- p-waterfall - Run promise-returning & async functions in series, each passing its result to the next
- p-each-series - Iterate over promises serially
- More…
![Empty State](/_next/static/media/empty.e5fae2e5.png)
No vulnerabilities found.
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 4/14 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:15: update your workflow using https://app.stepsecurity.io/secureworkflow/sindresorhus/p-series/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/sindresorhus/p-series/main.yml/main?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/main.yml:20
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 npmCommand dependencies pinned
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
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
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 4 are checked with a SAST tool
Score
3.6
/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 More