# popsicle-retry

> Enable request retry for Popsicle

Latest version **4.1.0** (published 2019-11-06) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install popsicle-retry
pnpm add popsicle-retry
yarn add popsicle-retry
bun add popsicle-retry
```

## 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 | 4.1.0 |
| Published | 2019-11-06 |
| First published | 2016-02-10 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 15.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Blake Embrey |
| Maintainers | blakeembrey |
| Keywords | popsicle, retry, fail, 5xx, error, http |

## Links

- npm: https://www.npmjs.com/package/popsicle-retry
- Repository: https://github.com/serviejs/popsicle-retry
- Issues: https://github.com/serviejs/popsicle-retry/issues
- npm.io page: https://npm.io/package/popsicle-retry

## Alternatives

- [@sentry/react-native](https://npm.io/package/@sentry/react-native.md) — 2.6M weekly downloads
- [@ardatan/aggregate-error](https://npm.io/package/@ardatan/aggregate-error.md) — 708.1K weekly downloads
- [custom-error-generator](https://npm.io/package/custom-error-generator.md) — 2.0K weekly downloads
- [@technik-sde/prosemirror-recreate-transform](https://npm.io/package/@technik-sde/prosemirror-recreate-transform.md) — 1.5K weekly downloads
- [@suchipi/error-utils](https://npm.io/package/@suchipi/error-utils.md) — 78 weekly downloads

## Recent versions

- 4.1.0 (latest) — 2019-11-06
- 4.0.0 — 2019-06-09
- 3.2.1 — 2016-06-20
- 3.2.0 — 2016-06-15
- 3.1.0 — 2016-05-08
- 3.0.1 — 2016-05-08
- 3.0.0 — 2016-05-08
- 2.0.0 — 2016-04-04
- 1.0.1 — 2016-02-10
- 1.0.0 — 2016-02-10

## README

# Popsicle Retry

[![NPM version][npm-image]][npm-url]
[![NPM downloads][downloads-image]][downloads-url]
[![Build status][travis-image]][travis-url]
[![Test coverage][coveralls-image]][coveralls-url]

> Enable request retry for Popsicle.

## Installation

```
npm install popsicle-retry --save
```

## Usage

```js
import { retry } from "popsicle-retry";

const send = retry(transport);
const res = await send(req);
```

### Methods

- **retry(fn, shouldRetry?)** Wraps a request function with retry support. Accepts a second function that returns a delay, or `-1` (default is `retries()`).
- **retryAllowed(error?, request?)** Check if a request should be retried. Defaults to `5xx` and unavailable errors.
- **retries(count?, isRetryAllowed?)** An exponential back-off function, defaulting to 3 retries.

## License

Apache 2.0

[npm-image]: https://img.shields.io/npm/v/popsicle-retry.svg?style=flat
[npm-url]: https://npmjs.org/package/popsicle-retry
[downloads-image]: https://img.shields.io/npm/dm/popsicle-retry.svg?style=flat
[downloads-url]: https://npmjs.org/package/popsicle-retry
[travis-image]: https://img.shields.io/travis/serviejs/popsicle-retry.svg?style=flat
[travis-url]: https://travis-ci.org/serviejs/popsicle-retry
[coveralls-image]: https://img.shields.io/coveralls/serviejs/popsicle-retry.svg?style=flat
[coveralls-url]: https://coveralls.io/r/serviejs/popsicle-retry?branch=master

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