npm / p-debounce
p-debounce
What changed in p-debounce 5 to 6, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-31.
4 breaking1 new APIs and options5 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initp-debounce 68 changes
Breaking changes 4
Other calls in the same window wait for the leading call and resolve with its result, even when it takes longer than wait.
Node.js 22 is now required to use p-debounce.
With after, each caller settles when its own execution completes instead of waiting for the whole queue.
A RangeError is thrown when wait exceeds 2147483647, rather than setTimeout treating the delay as 1ms.
Fixes and other changes 4
Callers no longer sometimes resolve with an old leading value from a previous window or after an abort.
Extra executions no longer start when the function calls itself synchronously or throws synchronously.
Later batches remain abortable after an earlier invocation finishes.
Types are fixed for functions returning either a promise or a plain value, and for explicit type arguments.
p-debounce 52 changes
New APIs and options 1
Adds the after option to pDebounce.promise().
Fixes and other changes 1
Preserves falsy promise rejection reasons.