Check whether a request can be retried based on the `error.code`
Installations
npm install is-retry-allowed
Developer
sindresorhus
Developer Guide
Module System
ESM
Min. Node Version
>=12
Typescript Support
No
Node Version
12.22.1
NPM Version
6.14.10
Statistics
78 Stars
22 Commits
18 Forks
3 Watching
1 Branches
6 Contributors
Updated on 06 Aug 2024
Languages
JavaScript (94.21%)
TypeScript (5.79%)
Total Downloads
Cumulative downloads
Total Downloads
2,090,548,460
Last day
-6.2%
1,389,978
Compared to previous day
Last week
3.8%
8,255,715
Compared to previous week
Last month
16.2%
33,443,982
Compared to previous month
Last year
2.3%
337,434,149
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
is-retry-allowed
Check whether a request can be retried based on the
error.code
Install
$ npm install is-retry-allowed
Usage
1import isRetryAllowed from 'is-retry-allowed'; 2 3isRetryAllowed({code: 'ETIMEDOUT'}); 4//=> true 5 6isRetryAllowed({code: 'ENOTFOUND'}); 7//=> false 8 9isRetryAllowed({}); 10//=> true
API
isRetryAllowed(error)
error
Type: Error | object
The .code
property, if it exists, will be used to determine whether retry is allowed.
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
security policy file detected
Details
- Info: security policy file detected: .github/security.md:1
- Info: Found linked content: .github/security.md:1
- Info: Found disclosure, vulnerability, and/or timelines in security policy: .github/security.md:1
- Info: Found text in security policy: .github/security.md:1
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 6/21 approved changesets -- score normalized to 2
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
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/sindresorhus/is-retry-allowed/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/sindresorhus/is-retry-allowed/main.yml/main?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/main.yml:21
- 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
no effort to earn an OpenSSF best practices badge detected
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 'main'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 7 are checked with a SAST tool
Score
4.2
/10
Last Scanned on 2024-11-18
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