# atmpt

> provides an easy way to make promises retry based on exceptions or result validation

Latest version **1.0.3** (published 2018-08-24) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2018-08-24 |
| First published | 2018-08-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Chad Scira |
| Maintainers | icodeforlove |

## Links

- npm: https://www.npmjs.com/package/atmpt
- Repository: https://github.com/icodeforlove/npm_atmpt
- Homepage: https://github.com/icodeforlove/npm_atmpt#readme
- Issues: https://github.com/icodeforlove/npm_atmpt/issues
- npm.io page: https://npm.io/package/atmpt

## Recent versions

- 1.0.3 (latest) — 2018-08-24
- 1.0.2 — 2018-08-24
- 1.0.1 — 2018-08-24
- 1.0.0 — 2018-08-24

## README

# atmpt [![Build Status](https://travis-ci.org/icodeforlove/npm_atmpt.png?branch=master)](https://travis-ci.org/icodeforlove/npm_atmpt)

provides an easy way to make promises retry based on exceptions

## install

```
npm install atmpt
```

## options

- delay (can be a number or function that returns a number, if its a function it gets called with an attempt argument)
- maxAttempts (the maximum amount of attempts)

## examples

heres a basic retry example

```javascript
await atmpt(async attempt => {
	/* logic */
});
```

and heres a little more advanced example with validation and custom delays

```javascript
await atmpt(async attempt => {
	/* logic */
}, {maxAttempts: 10, delay: attempt => attempt * 1000});
```

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