Gathering detailed insights and metrics for wait-for-throwable
Gathering detailed insights and metrics for wait-for-throwable
Gathering detailed insights and metrics for wait-for-throwable
Gathering detailed insights and metrics for wait-for-throwable
🧨 utility to retry an erroring function until it succeeds
npm install wait-for-throwable
Typescript
Module System
Min. Node Version
Node Version
NPM Version
69.1
Supply Chain
66.9
Quality
75.3
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
312,850
Last Day
241
Last Week
1,327
Last Month
8,271
Last Year
117,180
ISC License
1 Stars
32 Commits
1 Forks
2 Watchers
1 Branches
2 Contributors
Updated on Jan 31, 2024
Minified
Minified + Gzipped
Latest Version
1.0.1
Package Id
wait-for-throwable@1.0.1
Unpacked Size
4.49 kB
Size
2.28 kB
File Count
4
NPM Version
6.14.8
Node Version
14.9.0
Cumulative downloads
Total Downloads
Last Day
-12.7%
241
Compared to previous day
Last Week
-31.2%
1,327
Compared to previous week
Last Month
-11.5%
8,271
Compared to previous month
Last Year
37.4%
117,180
Compared to previous year
This method was inspired by built-in wait utilities in test frameworks, such as waitFor
in testing-library, waitUntil
in webdriverIO, or waitFor
in puppeteer. However, this module uses a standalone and generic implementation, allowing you to wait for and retry any function, both synchronous or Promise-based. You can use this in your tests directly with your favorite assertion helper.
1npm install wait-for-throwable
waitForThrowable()
→ Promise
Retries the provided method until it succeeds. The method is executed immediately, and if it fails, is retries at a defined internal until the total amount of wait time is reached. If the method succeeds at any time during the retries, the promise will resolve with the resulting value of the method. If the method continues to fail when the total timeout is reached, no more retries will occur and the promise will be rejected with the latest failure.
The arguments are:
method {Function}
: the method to retrym which can be a synchronous method or a promise-returning (or async
) method[options] {Object}
: options that define the behavior of the retries. Everything is optional.
[interval = 5] {Number}
: the amount of time to wait between retries[total = 2000] {Number}
: the total amount of time to retry. If this is used along with count
, retries will stop at whichever value is reached first.[count = Infinity] {Number}
: the maximum number of times to retry. If this is used along with total
, retries will stop at whichever value is reached first.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 1/26 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-05-05
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