What is is-retry-allowed?
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.
What are is-retry-allowed's main functionalities?
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
Other packages similar to is-retry-allowed
retry
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.
async-retry
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
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.