# sindresorhus/p-retry

Retry a promise-returning or async function

Repository: https://github.com/sindresorhus/p-retry
Canonical: https://ross.abutalabs.com/products/p-retry
Language: JavaScript
License: MIT
License Family: permissive
Last push: 2026-03-26T16:08:20+00:00

## Health v2 (maintenance only)
Score: 76/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 74, release rhythm 64, longevity 100
- inputs: {"age_days": 3603, "days_push": 160, "days_rel": 160, "gap_med": 83.5, "n_releases_24m": 5}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1027, forks 83 (observed 2026-08-28T04:03:16.873075+00:00)

## What it is
A small JavaScript library for retrying promise-returning or async functions with exponential backoff and customizable retry strategies. It supports aborting retries on non-retryable errors and provides failure context callbacks.

## Use cases
- retry failed http fetch requests
- add exponential backoff to async function calls
- retry flaky network operations in node
- stop retrying on 404 errors
- retry promise with custom retry strategy

## When to choose
- you need robust retry logic with exponential backoff for async operations
- you want fine-grained control over which errors are retried or aborted
- you need per-failure callbacks with retry state information

## When to avoid
- you need retry logic for non-promise synchronous code
- you need circuit breaker or rate limiting beyond simple retries
- your runtime lacks Promise support

## Facets
- artifact type: library
- maturity: active
- function: concurrency, error-handling
- domain: developer-tools, backend, web-development
- platform: browser
- tags: promise, retry, exponential-backoff, async, npm, nodejs, javascript

## Member repositories
- sindresorhus/p-retry (main) score 76

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:16.873075+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:07:54.981161+00:00, confidence not recorded.
  - readme: https://github.com/sindresorhus/p-retry (fetched 2026-08-28T04:03:16.873075+00:00, sha be1bcdfccbce)
  - registry_npm: https://registry.npmjs.org/p-retry (fetched 2026-08-29T13:08:00.105765+00:00, sha f02ea7c9b1f7)
- Data as of 2026-08-30T08:39:29.467469+00:00.
