p-retry
9.0.0 · 2 Nov 2026MIT78.2M / weekRepositoryHomepagenpmAtom feed
27 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 9.x · latest line
9.0.0
2 Nov 2026- Breaking
shouldConsumeRetryreturning nothing now counts astruee80456b
Breaking
- Breaking
Once
signalis aborted, the promise always rejects with the abort reason and no more callbacks are called dff55ff 1d8bd87 62d4a51Before, if the abort came during an attempt or a callback,
shouldConsumeRetry,onFailedAttempt, andshouldRetrycould still run. The promise could also reject with the operation's error instead of the abort reason.The abort reason now also wins over an
AbortErrorthrown by the operation.
- Breaking
shouldConsumeRetryreturning nothing now counts astruee80456bBefore, a callback that forgot to
returnmade failures skip theretriesbudget, so retries never ran out.
- Breaking
Validate the
randomize,unref, andsignaloptions e80456b dff55ffrandomizeandunrefmust be booleans, andsignalmust be anAbortSignal. Other values now throw aTypeError.
Improvements
Make the
messageargument ofAbortErroroptional 62d4a51Keep the
thistype of the function passed tomakeRetriable2f34d75Allow explicitly passing
undefinedfor options when usingexactOptionalPropertyTypes2f34d75
Fixes
Fix very long retry delays firing immediately 4100a6d
setTimeoutruns a delay above 2147483647ms (about 24.9 days) right away. Delays are now capped at that value.
Fix
NaNretry delay whenminTimeoutis0andfactorgrows toInfinity4100a6dFix a nested
AbortErrorescaping instead of its cause dff55ffFix a thrown value that cannot be stringified replacing the real failure 9ba0763
Fix the stack of the error wrapped by
AbortError00a53aa 33d5e2bIt now has the correct message and starts at the caller instead of inside p-retry.
Call
shouldConsumeRetryalso whenmaxRetryTimehas run out, so the callbacks always run in the documented order bd5d4a8Report
retryDelay: 0for aTypeErrorthat is never retried 127e14e
- 8.x
8.0.0
26 Mar 2026- Breaking
Require Node.js 22 85cdece
- Breaking
Change retry callback order 616306e
Add
retryDelaytoonFailedAttemptcontext (#66) 96cce98
Breaking
- Breaking
Require Node.js 22 85cdece
- Breaking
Change retry callback order 616306e
Callback order changed from
onFailedAttempt→shouldConsumeRetry→shouldRetrytoshouldConsumeRetry→onFailedAttempt→shouldRetry.Consumption decisions are now made before failure notifications and retry decisions.
Improvements
Add
retryDelaytoonFailedAttemptcontext (#66) 96cce98Fix
TypeErrorretry handling f011d2eHarden retry timing and callback validation 9d47b60
- 7.x
7.1.0
9 Oct 2025Add
shouldConsumeRetryoption (#96) 26d6e05
7.0.0
21 Aug 2025- Breaking
Require Node.js 20 3bdb53a
- Breaking
onFailedAttemptandshouldRetrynow receive acontextobject instead of a decoratederrorbff36bb
Breaking
- Breaking
Require Node.js 20 3bdb53a
- Breaking
onFailedAttemptandshouldRetrynow receive acontextobject instead of a decoratederrorbff36bbYou must now must access the error as
object.errorinstead ofobject.The use of
.attemptNumberand.retriesLeftdid not change.
- Breaking
Remove the
foreveroption (#79) 6a89827Many use-cases can use
{retries: Infinity}instead for infinite retries.
Improvements
Rewrite the package to not depend on the
retrypackage (#79) 6a89827This is a full rewrite, so test carefully.
Add
makeRetriablemethod 1a81c1e
- 6.x
6.2.0
20 Dec 2023Add
shouldRetryoption (#75) b993a96
6.1.0
26 Sep 2023Move network error detection into a separate package ba073f3
- 5.x
5.1.1
27 Apr 2022Lock the
@types/retrydependency 13f6350
5.1.0
19 Mar 2022Support
AbortController(#59) 352d62a
- 4.x
4.6.2
27 Apr 2022Reading the note…
4.6.1
13 Jul 2021Reading the note…
4.6.0
24 Jun 2021Reading the note…
4.5.0
29 Mar 2021Reading the note…
4.4.0
15 Feb 2021Reading the note…
4.3.0
23 Jan 2021Reading the note…
4.2.0
31 Oct 2019Reading the note…
4.1.0
31 Mar 2019Reading the note…
4.0.0
11 Mar 2019Reading the note…
- 3.x
3.0.1
14 Jan 2019Reading the note…
3.0.0
12 Dec 2018Reading the note…
- 2.x
2.0.0
26 Apr 2018Reading the note…
- 1.x
1.0.0
21 Oct 2016Reading the note…
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.