# is-retry-allowed

> Check whether a request can be retried based on the `error.code`

Latest version **3.0.0** (published 2021-04-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install is-retry-allowed
pnpm add is-retry-allowed
yarn add is-retry-allowed
bun add is-retry-allowed
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2021-04-17 |
| First published | 2016-01-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=12 |
| Dependencies | 0 |
| Unpacked size | 4.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 80 |
| Author | Sindre Sorhus |
| Maintainers | floatdrop, sindresorhus |
| Keywords | retry, retries, allowed, check, http, https, request, fetch |

## Links

- npm: https://www.npmjs.com/package/is-retry-allowed
- Repository: https://github.com/sindresorhus/is-retry-allowed
- Homepage: https://github.com/sindresorhus/is-retry-allowed#readme
- Issues: https://github.com/sindresorhus/is-retry-allowed/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/is-retry-allowed

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 3.0.0 (latest) — 2021-04-17
- 2.2.0 — 2020-12-27
- 2.1.0 — 2020-12-25
- 2.0.0 — 2020-12-25
- 1.2.0 — 2019-09-08
- 1.1.0 — 2016-07-02
- 1.0.0 — 2016-01-16

## README

# is-retry-allowed

> Check whether a request can be retried based on the `error.code`

## Install

```
$ npm install is-retry-allowed
```

## Usage

```js
import isRetryAllowed from 'is-retry-allowed';

isRetryAllowed({code: 'ETIMEDOUT'});
//=> true

isRetryAllowed({code: 'ENOTFOUND'});
//=> false

isRetryAllowed({});
//=> true
```

## API

### isRetryAllowed(error)

#### error

Type: `Error | object`

The `.code` property, if it exists, will be used to determine whether retry is allowed.

---

<div align="center">
	<b>
		<a href="https://tidelift.com/subscription/pkg/npm-is-retry-allowed?utm_source=npm-is-retry-allowed&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
	</b>
	<br>
	<sub>
		Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
	</sub>
</div>

---
_Source: https://npm.io/package/is-retry-allowed · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
