NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm, #1089 most downloaded on npm
Retry a promise-returning or async function
Latest stable
9.0.0
Last release 20 days ago
02 Nov 2026
Release timing varies
gaps range from 5 weeks to 11 months
Nearly every release is documented
notes for 25 of 27 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
28 releases · first in 2016
Drag across the ruler to compare, or tap a release to open it.
Once signal is aborted, the promise always rejects with the abort reason and no more callbacks are called dff55ff 1d8bd87 62d4a51
signal is aborted, the promise always rejects with the abort reason and no more callbacks are called dff55ff 1d8bd87 62d4a51
shouldConsumeRetry, onFailedAttempt, and shouldRetry could still run. The promise could also reject with the operation's error instead of the abort reason.AbortError thrown by the operation.shouldConsumeRetry returning nothing now counts as true e80456b
return made failures skip the retries budget, so retries never ran out.randomize, unref, and signal options e80456b dff55ff
randomize and unref must be booleans, and signal must be an AbortSignal. Other values now throw a TypeError.message argument of AbortError optional 62d4a51this type of the function passed to makeRetriable 2f34d75undefined for options when using exactOptionalPropertyTypes 2f34d75setTimeout runs a delay above 2147483647ms (about 24.9 days) right away. Delays are now capped at that value.NaN retry delay when minTimeout is 0 and factor grows to Infinity 4100a6dAbortError escaping instead of its cause dff55ffAbortError 00a53aa 33d5e2b
shouldConsumeRetry also when maxRetryTime has run out, so the callbacks always run in the documented order bd5d4a8retryDelay: 0 for a TypeError that is never retried 127e14ehttps://github.com/sindresorhus/p-retry/compare/v8.0.1...v9.0.0
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Fix error for invalid fractional retry counts 3c22035
https://github.com/sindresorhus/p-retry/compare/v8.0.0...v8.0.1
Change retry callback order 616306e
onFailedAttempt → shouldConsumeRetry → shouldRetry to shouldConsumeRetry → onFailedAttempt → shouldRetry.retryDelay to onFailedAttempt context (#66) 96cce98TypeError retry handling f011d2ehttps://github.com/sindresorhus/p-retry/compare/v7.1.1...v8.0.0
Fix delayed abort when signal is already aborted before delay phase 2aba573
https://github.com/sindresorhus/p-retry/compare/v7.1.0...v7.1.1
Add `shouldConsumeRetry` option (#96) 26d6e05
shouldConsumeRetry option (#96) 26d6e05https://github.com/sindresorhus/p-retry/compare/v7.0.0...v7.1.0
onFailedAttempt and shouldRetry now receive a context object instead of a decorated error bff36bb
onFailedAttempt and shouldRetry now receive a context object instead of a decorated error bff36bb
object.error instead of object..attemptNumber and .retriesLeft did not change.forever option (#79) 6a89827
{retries: Infinity} instead for infinite retries.retry package (#79) 6a89827
makeRetriable method 1a81c1ehttps://github.com/sindresorhus/p-retry/compare/v6.2.1...v7.0.0
Nothing published for this version
Fix onFailedAttempt and shouldRetry options being undefined (#82) b400af6
onFailedAttempt and shouldRetry options being undefined (#82) b400af6https://github.com/sindresorhus/p-retry/compare/v6.2.0...v6.2.1
Add `shouldRetry` option (#75) b993a96
shouldRetry option (#75) b993a96https://github.com/sindresorhus/p-retry/compare/v6.1.0...v6.2.0
Move network error detection into a separate package ba073f3
https://github.com/sindresorhus/p-retry/compare/v6.0.0...v6.1.0
Correctly remove abort handler when done 95a3a4a
https://github.com/sindresorhus/p-retry/compare/v5.1.2...v6.0.0
Add Undici network error handling (#68) fb5f6f8
https://github.com/sindresorhus/p-retry/compare/v5.1.1...v5.1.2
Lock the @types/retry dependency 13f6350
@types/retry dependency 13f6350https://github.com/sindresorhus/p-retry/compare/v5.1.0...v5.1.1
Support `AbortController` (#59) 352d62a
AbortController (#59) 352d62ahttps://github.com/sindresorhus/p-retry/compare/v5.0.0...v5.1.0
This package is now pure ESM. Please [read this](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c).
https://github.com/sindresorhus/p-retry/compare/v4.6.1...v5.0.0
Backport https://github.com/sindresorhus/p-retry/commit/13f63501d06759671ca33a05b8af74d58b1138c5 to v4
Fix retrying on network error in Firefox and Safari (#52) 7828c0a
https://github.com/sindresorhus/p-retry/compare/v4.6.0...v4.6.1
Upgrade dependencies (#50) 5a1c2a3
https://github.com/sindresorhus/p-retry/compare/v4.5.0...v4.6.0
Support cross-fetch for retrying on network errors (#44) 23e67ab
cross-fetch for retrying on network errors (#44) 23e67abhttps://github.com/sindresorhus/p-retry/compare/v4.4.0...v4.5.0
Retry on network errors in Firefox and Safari too (#42) 7d4b031
https://github.com/sindresorhus/p-retry/compare/v4.3.0...v4.4.0
Ignore window.fetch network error (#38) c62b158
window.fetch network error (#38) c62b158https://github.com/sindresorhus/p-retry/compare/v4.2.0...v4.3.0
Allow onFailedAttempt to be async (#30) 67afe2a
onFailedAttempt to be async (#30) 67afe2ahttps://github.com/sindresorhus/p-retry/compare/v4.1.0...v4.2.0
Refactor TypeScript definition to CommonJS compatible export (#23) 71e51ad
https://github.com/sindresorhus/p-retry/compare/v4.0.0...v4.1.0
Require Node.js 8 0ed8d5d (#21) 4b6ec19
Breaking:
Enhancements:
https://github.com/sindresorhus/p-retry/compare/v3.0.1...v4.0.0
Fix incorrect usage example in the readme https://github.com/sindresorhus/p-retry/commit/6ef29e7012e6ff720b4f89d1ffd7f485cf9ce8ef
Fix the onFailedAttempt method. (https://github.com/sindresorhus/p-retry/issues/11) https://github.com/sindresorhus/p-retry/commit/bf701364d94e776fc0f
onFailedAttempt method. (https://github.com/sindresorhus/p-retry/issues/11) https://github.com/sindresorhus/p-retry/commit/bf701364d94e776fc0ff4dfe057e10fa83e919c0
onFailedAttempt before final rejection.Nothing published for this version
Nothing published for this version
One column per quarter.