Node.js · Middle · Question 26 of 75
What is AbortController used for in Node.js?
- 1Stopping the whole process
- ✓Correct answer: Cancelling async operations such as
fetch, timers,fsreads andevents.oncevia anAbortSignal - 3Killing child processes only
Explanation
Many Node.js APIs accept { signal }. AbortSignal.timeout(5000) creates a signal that aborts after 5 seconds, which is a simple way to add timeouts.