Gathering detailed insights and metrics for @byungi/p-retry
Gathering detailed insights and metrics for @byungi/p-retry
npm install @byungi/p-retry
Typescript
Module System
Min. Node Version
Node Version
NPM Version
TypeScript (100%)
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Total Downloads
6,532
Last Day
1
Last Week
5
Last Month
158
Last Year
980
3 Stars
101 Commits
1 Forks
2 Watchers
2 Branches
1 Contributors
Updated on Nov 21, 2021
Minified
Minified + Gzipped
Latest Version
0.2.2
Package Id
@byungi/p-retry@0.2.2
Unpacked Size
3.51 kB
Size
1.54 kB
File Count
4
NPM Version
lerna/3.20.2/node@v12.11.1+x64 (win32)
Node Version
12.11.1
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
-95.8%
5
Compared to previous week
Last Month
338.9%
158
Compared to previous month
Last Year
-49.7%
980
Compared to previous year
2
Retry when promise fails.
1const runner = async () => { 2 await asyncJobOrFail() 3} 4 5try{ 6 await pRetry(runner, {retries: 3}) 7}catch(err){ 8 console.log('3 retries, but all failed.') 9}
Retry when promise fails.
A function that retries when a promise is rejected. This function should return promise.
retries
- Number of retries. Default is 1.interval
- Delay before retry. Default is 0.Do not retry anymore and throw a CancelError
.
1import pRetry, {CancelError} from '@byungi/p-retry' 2 3const retryPromise = pRetry(asyncAlwaysFailRequest, {retries: 1000}) 4 5setTimeout(()=> retryPromise.cancel(), 100) // After 100ms, retry is aborted. 6 7retryPromise.catch(err => { 8 console.log(err.isCanceled) // => true 9 console.log(err instanceof CancelError) // => true 10 console.log(retryPromise.isCanceled) // => true 11})
Returns whether the promise is canceled.
Similar to then
but can propagate cancel
to the upper promise.
1const handleWithRequestPromise = retryPromise.pipe(response => { 2 handleResponse(response) 3}) 4 5handleWithRequestPromise.cancel() // => retry is aborted.
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
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
security policy file not detected
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-03-03
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