Async Patterns & Control Flow

Every subchapter in this chapter, free to read online. Work through them in order, or jump straight to the runtime detail you need.

07
chapter
6
subchapters
Free
online
01

Error-First Callbacks

How Node.js error-first callbacks work, why the first argument carries errors, and how callback dispatch connects native async work back to JavaScript.

02

Promise Microtasks

How Node.js orders Promise jobs, process.nextTick callbacks, queueMicrotask work, timers, and I/O across CommonJS, ES modules, and active microtask drains.

03

Async/Await

How async functions and await work in Node.js through promise wrapping, suspension, resumption, microtasks, errors, and V8 state machines.

04

EventEmitter Internals

How EventEmitter stores listeners, dispatches emit synchronously, handles error events, preserves listener order, and reports possible leaks.

05

Async Iterators

How async iterators work in Node.js through Symbol.asyncIterator, for await...of, async generators, stream consumption, and backpressure.

06

Promise Combinators

How Promise.all, allSettled, race, and any behave in Node.js, including short-circuiting, failure propagation, cancellation gaps, and concurrency limits.

Other chapters

14 more