Browse all chapters and topics in NodeBook
Click to view all topics in this chapter →
Understanding the Node.js runtime architecture, from V8 to libuv, and how JavaScript executes outside the browser.
Deep dive into V8's compilation pipeline, hidden classes, inline caching, and performance optimization techniques.
Understanding Node.js event loop, phases, and how asynchronous operations are orchestrated in the runtime.
Understanding the complete lifecycle of a Node.js process from bootstrap to graceful shutdown.
Click to view all topics in this chapter →
Understanding binary data handling in Node.js through Buffers, the foundation for working with raw memory.
Learn efficient buffer allocation strategies, pooling mechanisms, and memory management techniques in Node.js.
Practical guide to manipulating buffers, conversions, encodings, and common operations with binary data.
Understanding memory fragmentation, challenges with buffer management, and solutions for optimal performance.
Click to view all topics in this chapter →
Introduction to streams in Node.js, understanding the core concepts and why streams are essential for scalable applications.
Deep dive into readable streams, implementing custom streams, and understanding flowing and paused modes.
Understanding writable streams, implementing custom writable streams, and handling backpressure effectively.
Understanding Transform and Duplex streams, implementing custom transformations, and learning when to use each stream type.
Learn how to compose streams with pipe() and pipeline(), handle errors correctly, and build streaming pipelines that won't fall over with proper backpressure and cleanup.
Performance optimization techniques for Node.js streams including zero-copy operations, vectored I/O with writev/readv, buffer pooling to reduce GC pressure, and strategic cork/uncork patterns.
Click to view all topics in this chapter →
How file descriptors work at the OS level, the kernel's per-process file table, and Node.js fs.open internals.
Reading and writing files in Node.js with fs.readFile, fs.writeFile, and their synchronous counterparts.
The fs.promises API, FileHandle objects, and migrating from callbacks to async/await file operations.
File watching with fs.watch, atomic write patterns, temp files, and safe file replacement strategies.
File permissions, ownership, stat metadata, symlinks, and edge cases with /dev, /proc, and sparse files.
Click to view all topics in this chapter →
The process global in Node.js -- environment variables, argv parsing, memory usage, and the C++ bindings underneath.
POSIX signals, exit codes, graceful shutdown patterns, and how Node.js handles SIGINT, SIGTERM, and uncaught exceptions.
The os module for system introspection -- CPU info, memory, network interfaces, and platform detection.
stdin, stdout, and stderr in Node.js -- how standard I/O streams work, TTY detection, and piping behavior.
Click to view all topics in this chapter →
How require() works internally -- the Module._load chain, source wrapping, compilation, and the module cache.
Node.js module resolution -- how specifiers become file paths, node_modules traversal, and package.json exports.
ES Modules in Node.js -- static analysis, the parse-link-evaluate pipeline, and how Node determines module format.
Interop between CommonJS and ES Modules -- require of ESM, import of CJS, dual packages, and conditional exports.
import.meta properties, the ESM module cache, and how circular dependencies resolve in ES Modules.
Click to view all topics in this chapter →
Error-first callbacks, sync vs async invocation, callback hell, and how Node's core APIs enforce the convention.
Promise state machines, the microtask queue, V8's internal slots, thenable assimilation, and scheduling order.
How V8 compiles async functions into state machines, suspend/resume mechanics, and the implicit promise wrapping.
The _events object, synchronous dispatch, listener storage optimizations, the error event contract, and memory leak warnings.
The async iteration protocol, Symbol.asyncIterator, for-await-of mechanics, and backpressure with async generators.
Promise.all, allSettled, race, any -- short-circuit semantics, failure propagation, and concurrency limiting patterns.