# @huudan/retry-promise-util

> Retries a function returning a promise with a delay between each retry

Latest version **0.7.0** (published 2021-02-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install @huudan/retry-promise-util
pnpm add @huudan/retry-promise-util
yarn add @huudan/retry-promise-util
bun add @huudan/retry-promise-util
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.7.0 |
| Published | 2021-02-28 |
| First published | 2021-02-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 9.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Dan Nguyen |
| Maintainers | nghuudan |
| Keywords | retry, promise, util |

## Links

- npm: https://www.npmjs.com/package/@huudan/retry-promise-util
- Repository: https://github.com/nghuudan/retry-promise-util
- Homepage: https://github.com/nghuudan/retry-promise-util#readme
- Issues: https://github.com/nghuudan/retry-promise-util/issues
- npm.io page: https://npm.io/package/@huudan/retry-promise-util

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 0.7.0 (latest) — 2021-02-28

## README

# @huudan/retry-promise-util
Retries a function returning a promise with a delay between each retry

## Usage
```js
import { retryPromise } from '@huudan/retry-promise-util';

retryPromise(() => fetch('https://api.example.com'), {
  delay: 2000, // Milliseconds between each retry
  multiplier: 2, // Multiplier for delay (ex: 2000, 4000, 8000...)
  retries: 3 // Number of retries after the promise is rejected
}).then((response) => response.json())
  .then(console.log)
  .catch(console.error);
```

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