Installations
npm install wait-for-throwable
Developer Guide
Typescript
No
Module System
CommonJS
Min. Node Version
>=10.0.0
Node Version
14.9.0
NPM Version
6.14.8
Score
68.2
Supply Chain
66.9
Quality
75.3
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
catdad
Download Statistics
Total Downloads
271,420
Last Day
116
Last Week
1,195
Last Month
6,690
Last Year
116,402
GitHub Statistics
1 Stars
32 Commits
1 Forks
3 Watching
1 Branches
2 Contributors
Package Meta Information
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
Total Downloads
Cumulative downloads
Total Downloads
271,420
Last day
-73.3%
116
Compared to previous day
Last week
-23.1%
1,195
Compared to previous week
Last month
-14.5%
6,690
Compared to previous month
Last year
53.2%
116,402
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
wait-for-throwable
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.
Install
1npm install wait-for-throwable
API
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 (orasync
) 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 withcount
, retries will stop at whichever value is reached first.[count = Infinity] {Number}
: the maximum number of times to retry. If this is used along withtotal
, retries will stop at whichever value is reached first.
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: ISC License: LICENSE:0
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
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/ci.yml:1
- Info: no jobLevel write permissions found
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/catdad/wait-for-throwable/ci.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/catdad/wait-for-throwable/ci.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:35: update your workflow using https://app.stepsecurity.io/secureworkflow/catdad/wait-for-throwable/ci.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/catdad/wait-for-throwable/ci.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/catdad/wait-for-throwable/ci.yml/master?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/ci.yml:27
- Info: 0 out of 5 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 npmCommand dependencies pinned
Reason
no effort to earn an OpenSSF best practices badge detected
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
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 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 6 are checked with a SAST tool
Score
3.4
/10
Last Scanned on 2024-12-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