Globals
AbortController.abort()
Signals cancellation to consumers of controller.signal. Consumers must support cancellation; completed side effects are not reversed.
Formal Syntax & Structure
nodejs syntaxnodejs
controller.abort([reason])Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| reason | any | Optional reason for cancellation. |
Return Value
undefined
Signals the associated AbortSignal.
Working Example
Example Snippetnodejs
const c = new AbortController();c.abort();console.log(c.signal.aborted);