Gathering detailed insights and metrics for p-settle
Gathering detailed insights and metrics for p-settle
Gathering detailed insights and metrics for p-settle
Gathering detailed insights and metrics for p-settle
Settle promises concurrently and get their fulfillment value or rejection reason with optional limited concurrency
npm install p-settle
Typescript
Module System
Min. Node Version
Node Version
NPM Version
99.4
Supply Chain
95.8
Quality
75.7
Maintenance
100
Vulnerability
100
License
JavaScript (82.24%)
TypeScript (17.76%)
Total Downloads
111,809,927
Last Day
15,363
Last Week
544,216
Last Month
2,376,774
Last Year
27,201,629
MIT License
91 Stars
35 Commits
11 Forks
5 Watchers
1 Branches
7 Contributors
Updated on Jan 23, 2025
Minified
Minified + Gzipped
Latest Version
5.1.1
Package Id
p-settle@5.1.1
Unpacked Size
6.80 kB
Size
2.77 kB
File Count
5
NPM Version
9.2.0
Node Version
18.16.1
Published on
Oct 09, 2023
Cumulative downloads
Total Downloads
Last Day
-15.5%
15,363
Compared to previous day
Last Week
-10.2%
544,216
Compared to previous week
Last Month
-1.2%
2,376,774
Compared to previous month
Last Year
-8.7%
27,201,629
Compared to previous year
Settle promises concurrently and get their fulfillment value or rejection reason
1npm install p-settle
1import fs from 'node:fs/promises'; 2import pSettle from 'p-settle'; 3 4const files = [ 5 'a.txt', 6 'b.txt' // Doesn't exist 7].map(fileName => fs.readFile(fileName, 'utf8')); 8 9console.log(await pSettle(files)); 10/* 11[ 12 { 13 status: 'fulfilled', 14 value: '🦄', 15 isFulfilled: true, 16 isRejected: false, 17 }, 18 { 19 status: 'rejected', 20 reason: [Error: ENOENT: no such file or directory, open 'b.txt'], 21 isFulfilled: false, 22 isRejected: true, 23 } 24] 25*/
Returns a Promise<object[]>
that is fulfilled when all promises from the array
argument are settled.
The objects in the array have the following properties:
status
('fulfilled'
or 'rejected'
, depending on how the promise resolved)value
or reason
(Depending on whether the promise fulfilled or rejected)isFulfilled
isRejected
Type: Array<ValueType | PromiseLike<ValueType> | ((...args: any[]) => PromiseLike<ValueType>)>
The array can contain a mix of any value, promise, and async function. Promises are awaited. Async functions are executed and awaited. The concurrency
option only works for elements that are async functions.
Type: object
Type: number
(Integer)
Default: Infinity
Minimum: 1
The number of concurrently pending promises.
Note: This only limits concurrency for elements that are async functions, not promises.
This is a type guard for TypeScript users.
This is useful since await pSettle(promiseArray)
always returns a PromiseResult[]
. This function can be used to determine whether PromiseResult
is PromiseFulfilledResult
or PromiseRejectedResult
.
This is a type guard for TypeScript users.
This is useful since await pSettle(promiseArray)
always returns a PromiseResult[]
. This function can be used to determine whether PromiseResult
is PromiseRejectedResult
or PromiseFulfilledResult
.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 7/30 approved changesets -- score normalized to 2
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
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
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-23
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