npm / p-cancelable
p-cancelable
What changed in p-cancelable 2 to 5, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-05.
6 breaking1 behavior and defaults5 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initp-cancelable 56 changes
Breaking changes 1
Node.js 22 is now required to use p-cancelable.
Behavior and default changes 1
Cancellation is allowed while an adopted promise is pending.
Fixes and other changes 4
Errors are preserved during resolution and cancellation.
Types no longer claim that static Promise methods exist on PCancelable.
All cancel handlers run even if one throws.
The state is settled when the executor throws.
p-cancelable 42 changes
Breaking changes 1
Node.js 14 is now required to use p-cancelable.
Fixes and other changes 1
The error message is improved when attaching onCancel after the promise has settled.
p-cancelable 31 changes
Breaking changes 1
The package is now pure ESM, so developers must use it as an ES module.
p-cancelable 23 changes
Breaking changes 3
Node.js 8 is now required.
Calling onCancel after the promise settles now throws an error.
The TypeScript definition now uses a CommonJS-compatible export; TypeScript users need to switch to the require-style import.