# retryp

> provide a promise retry utility

Latest version **0.0.4** (published 2019-04-26) · ISC license · 0 weekly downloads

## Install

```sh
npm install retryp
pnpm add retryp
yarn add retryp
bun add retryp
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2019-04-26 |
| First published | 2019-03-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 96.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | chiachun0920@gmail.com |
| Maintainers | chiachun0920 |
| Keywords | retry, promise, repeat, replay |

## Links

- npm: https://www.npmjs.com/package/retryp
- Repository: https://github.com/chiachun0920/retryp
- Homepage: https://github.com/chiachun0920/retryp#readme
- Issues: https://github.com/chiachun0920/retryp/issues
- npm.io page: https://npm.io/package/retryp

## Dependencies (1)

- [efficient-timeout](https://npm.io/package/efficient-timeout.md) ^0.0.0

## Alternatives

- [promise-throttle](https://npm.io/package/promise-throttle.md) — 44.2K weekly downloads
- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads

## Recent versions

- 0.0.4 (latest) — 2019-04-26
- 0.0.3 — 2019-03-28
- 0.0.2 — 2019-03-28
- 0.0.1 — 2019-03-25
- 0.0.0 — 2019-03-22

## README

# retryp

Provide a function to retry promise if encountering an error, and return promise.

## Installation

`$ npm install retryp` or  `$ yarn add retryp` 

## Usage

### retryp(function, options)

The `function` is a promise, and it will be retried based of options provide if some error occurs.

The `options` argument is an object.
  - `limit`: The maximum amount of times to retry the operation. Default is `10`.
  - `interval`: The number of milliseconds between two retries. Default is `1000`. 

## Example
```js
import retryp from 'retryp';
// var retryp = require('retryp').default;

// Simple example

const doSomethingAsync = async () => {
  // ...
};

try {
  await retryp(doSomethingAsync, options = { limit: 100, interval: 1000 });
} catch (err) {
  console.log(err);
}

```

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