Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
is-retry-allowed
Advanced tools
The is-retry-allowed npm package is used to determine if a given error is transient and likely to be resolved by retrying the failed operation. It checks the error against a list of known transient errors and returns a boolean indicating whether a retry should be allowed.
Check if a retry is allowed for a given error
This feature allows you to pass an error object to the isRetryAllowed function, which returns true if the error is considered transient and retryable, or false otherwise.
const isRetryAllowed = require('is-retry-allowed');
const error = new Error('ECONNRESET');
const shouldRetry = isRetryAllowed(error);
console.log(shouldRetry); // Output: true
The retry package provides a set of functions for retrying asynchronous functions. It is more feature-rich than is-retry-allowed, offering a flexible approach to control the number of retries, timeouts, and the interval between retries.
Similar to retry, async-retry is a library for retrying a function which returns a Promise. It supports custom retry strategies and has a simple API, but it does not provide a built-in mechanism to determine if an error is retryable.
p-retry is a library for retrying promises with a configurable number of attempts. It is promise-based and allows for custom retry conditions, but unlike is-retry-allowed, it does not come with a predefined list of retryable errors.
Is retry allowed for Error?
$ npm install --save is-retry-allowed
const isRetryAllowed = require('is-retry-allowed');
isRetryAllowed({code: 'ETIMEDOUT'});
//=> true
isRetryAllowed({code: 'ENOTFOUND'});
//=> false
isRetryAllowed({});
//=> true
Type: object
Object with code
property, which will be used to determine retry.
MIT © Vsevolod Strukchinsky
FAQs
Check whether a request can be retried based on the `error.code`
The npm package is-retry-allowed receives a total of 5,623,744 weekly downloads. As such, is-retry-allowed popularity was classified as popular.
We found that is-retry-allowed demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.