COMPLETE INDEX · VOLUME I

Everything, indexed.

Browse every chapter and topic in NodeBook. Search to jump straight to the runtime detail you need.

10
chapters
53
topics
Free
online
53 topics
CHAPTER 01

Node.js Architecture

4 topics

What Node.js Is

What Node.js is, how V8, libuv, native bindings, and core APIs fit together, and how JavaScript reaches files, sockets, timers, and the OS.

V8 in Node.js

How the V8 JavaScript engine architecture in Node.js runs Ignition bytecode, tiered JIT compilation, shapes, inline caches, and deoptimization.

Node.js Event Loop

Node.js event loop explained through libuv phases, timers, poll, check, close callbacks, process.nextTick, promise microtasks, and setImmediate order.

Node.js Process Lifecycle

A normal Node.js process starts by initializing V8 and libuv, loading the entry module, then staying alive while referenced handles and requests remain active.

CHAPTER 02

Buffers

4 topics

What Is a Buffer?

What a Buffer is in Node.js: a fixed-size mutable byte sequence for files, sockets, hashes, images, compressed payloads, and undecoded I/O.

Buffer Allocation

How Buffer.alloc, Buffer.allocUnsafe, Buffer.from, slab pooling, and large Buffer allocation affect memory safety and performance in Node.js.

Buffer Operations

How Buffer views, copies, TypedArray interop, worker transfer, and zero-copy parsing affect byte ownership in Node.js.

Buffer Fragmentation, Retained Views, and External Memory

How Buffer allocation can fragment external memory, pin large backing stores, interact with V8 accounting, and create performance problems in Node.js.

CHAPTER 03

Streams

6 topics

Stream Foundations

How Node.js moves chunked data through stream queues, consumption modes, and backpressure without treating every input as one value.

Readable Streams

How Node.js Readable streams buffer data, switch between flowing and paused mode, apply highWaterMark, and signal backpressure.

Writable Streams

How Writable streams accept chunks, buffer writes, use highWaterMark, return false from write, and emit drain for backpressure.

Transform Streams

How Transform and Duplex streams work in Node.js, how _transform and _flush emit output, and how backpressure crosses both sides.

Stream Pipeline

How pipe, stream.pipeline, finished, async pipeline stages, AbortSignal, side outputs, and partial-output cleanup work in current Node.js stream pipelines.

Zero-Copy Streams

How Buffer ownership, fs.copyFile, writev, _writev, cork, and copy-path measurement shape hot Node.js stream paths.

CHAPTER 04

File System

5 topics

File Descriptors & Handles

How file descriptors and FileHandle objects map to OS file state, open flags, close behavior, libuv work, and EMFILE failures.

File I/O

How Node.js reads and writes files through whole-file helpers, streams, low-level read/write calls, append mode, and durable flushes.

fs.promises & FileHandle

How fs.promises and FileHandle work in Node.js, including async file operations, descriptor ownership, stream lifecycles, cleanup, and controlled concurrency.

fs.watch & Atomic Writes

How fs.watch, fs.watchFile, OS watcher backends, and atomic replacement patterns interact in real file workflows.

Permissions & Metadata

How Node.js exposes file permissions, ownership, stat metadata, symlinks, inodes, sparse files, special paths, and filesystem edge cases.

CHAPTER 05

Process & OS

4 topics

process Object

How the Node.js process object exposes env, argv, pid, cwd, exit state, memory usage, versions, IPC, and native process bindings.

Signals & Exit Codes

How Node.js handles SIGTERM, SIGINT, exit codes, beforeExit, exit, uncaught exceptions, and graceful shutdown across process scopes.

os Module

How the Node.js os module reports CPU counts, available parallelism, memory, load average, network interfaces, paths, users, and platform data.

Standard I/O

How Node.js standard input, output, and error streams map to file descriptors, TTYs, pipes, console output, and backpressure.

CHAPTER 06

The Module System

5 topics

CJS require() Internals

How Node.js require works internally through resolution, Module._load, source wrapping, compilation, module.exports, and require.cache.

Module Resolution

How Node.js resolves module specifiers through built-ins, relative paths, node_modules lookup, package.json main, exports, imports, and symlinks.

ES Modules

How ES Modules work in Node.js through static import/export syntax, module format detection, parse-link-evaluate phases, and live bindings.

CommonJS/ESM Interop

How CommonJS and ES Modules interoperate in Node.js through CJS namespaces, require(esm), conditional exports, and dual package design.

import.meta & ESM Caching

How import.meta, import.meta.url, import.meta.dirname, the ESM module cache, circular dependencies, and module state work in Node.js.

CHAPTER 07

Async Patterns & Control Flow

6 topics

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.

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.

Async/Await

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

EventEmitter Internals

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

Async Iterators

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

Promise Combinators

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

CHAPTER 08

Runtime Platform APIs & Tooling

5 topics

CLI Flags

How Node.js consumes startup flags, NODE_OPTIONS, preloads, V8 options, source maps, conditions, warnings, diagnostics, memory flags, node --run, and experimental config files.

.env Files

How Node.js loads .env files with --env-file, parses DotEnv syntax, resolves precedence, handles NODE_OPTIONS, uses process.loadEnvFile() and util.parseEnv(), and turns raw strings into validated config.

Web Platform APIs

How Node.js exposes web-compatible globals including fetch, Request, Response, Web Streams, Blob, File, FormData, URL, and structuredClone.

TypeScript & Compile Cache

How Node.js v24.15 runs TypeScript through type stripping, handles .ts module formats, rejects unsupported syntax, and stores compile cache data.

REPL, Inspector, Watch & SEA

How Node.js REPL, inspector sessions, watch mode, and single executable applications evaluate code, expose debugging state, restart, and package apps.

CHAPTER 09

Network Fundamentals with Node.js

7 topics

TCP/IP Networking

How Node.js networking depends on OS sockets, TCP/IP state, addresses, ports, routing, link-layer resolution, MTU, and libuv handles.

DNS Resolution

How Node.js resolves hostnames through dns.lookup, dns.resolve, OS resolver behavior, c-ares, recursive DNS, TTLs, caching, and address ordering.

TCP Flow & Failure

How Node.js TCP connections move through handshake, flow control, ordered delivery, FIN, RST, ECONNRESET, EPIPE, ETIMEDOUT, and shutdown.

Sockets and net

How Node.js net.Server and net.Socket wrap OS socket state, libuv TCP handles, connection events, writes, shutdown, timeouts, and IPC endpoints.

UDP and dgram

How Node.js UDP sockets work through dgram, datagram framing, send and message events, bind state, broadcast, multicast, connected UDP, and errors.

Socket Options & Backlog

How Node.js exposes socket options including keepAlive, noDelay, backlog, SO_REUSEADDR, send and receive buffers, IPv4/IPv6 binding, and dual stack behavior.

Request Path

Trace a Node.js connection from hostname lookup through address selection, routing, TCP connect, accept queues, libuv readiness, and JavaScript callbacks.

CHAPTER 10

HTTP Servers, Clients & Proxies

7 topics

HTTP/1.1 Wire Format

Read HTTP/1.1 as bytes: start lines, headers, body framing, chunked transfer coding, connection rules, and interim responses.

http.Server Lifecycle

Trace one inbound HTTP request through http.Server, accepted sockets, IncomingMessage, ServerResponse, header commits, early bodies, parser errors, timeouts, and connection reuse.

HTTP Parsing with llhttp

How Node.js turns HTTP/1.1 bytes into IncomingMessage objects through llhttp state, parser callbacks, header limits, body delivery, errors, trailers, and upgrade handoff.

Routing and Middleware

Build a small framework-free HTTP handler with method and path routing, middleware composition, bounded JSON body parsing, and deliberate error responses.

Keep-Alive, Agents, and Pools

How Node.js reuses HTTP/1.1 TCP connections through keep-alive, http.Agent pools, server idle timers, stale pooled sockets, and reuse limits.

fetch and Undici

How outbound HTTP works in Node.js, from http.request() and ClientRequest through fetch, Undici dispatchers, pools, redirects, decoding, and pipelining.

Proxies, Static Files, and Streaming

Build the HTTP boundary where Node forwards requests, streams bodies, filters connection metadata, and serves file-backed responses.