Node.js Cheat Sheet
|
This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production. The reference material consulted while preparing these pages is listed in the section bibliography. |
A single-page, colour-coded summary of the Node.js essentials, written against Node.js 26 (26.10.0, Current; it becomes LTS on 2026-10-28), with the differences of Node.js 24 LTS (24.21.0) and Node.js 22 (22.23.3, Maintenance) called out, and npm 11 as bundled with those lines (versions verified 2026-10-03) — what the runtime is made of, the CLI and REPL, CommonJS and ES modules, npm, the event loop, promises and events, process and error handling, files and streams, built-in SQLite, HTTP and networking, concurrency, the test runner, diagnostics, security, TypeScript type stripping, production, and a strip of what changed since older tutorials — handy for quick memorization or as a downloadable PDF desk reference.
For the full explanation, every option, and additional examples, see the dedicated pages:
Start here — Node.js and its Bibliography.
Foundations — Introduction & Architecture, Installing Node.js, Release Lines & LTS, Running Scripts, the CLI & the REPL, CLI Options, Environment & Config File, and Globals & Web Platform APIs.
Modules & packages — CommonJS Modules, ECMAScript Modules, ESM & CommonJS Interop, package.json, exports & imports, npm & Package Management, and Workspaces & Publishing.
Asynchrony — The Event Loop, Callbacks, Promises & async/await, Timers, Events & EventEmitter, Don’t Block the Event Loop, and Async Context & Cancellation.
Core APIs — Process, Signals & Exit Codes, Errors & Error Handling, Buffers & Binary Data, The util Module, os, path & URL, and Console, readline & Terminal I/O.
Files, streams & data — The File System, Directories, Glob & Watch, Streams, Implementing Custom Streams, Web Streams & Interop, Compression with zlib, Built-in SQLite, and Databases from Node.js.
Networking & HTTP — HTTP Server Fundamentals, HTTPS, TLS & HTTP/2, fetch & HTTP Clients, WebSockets & Server-Sent Events, TCP, UDP & DNS, and Server Timeouts, Limits & Hardening.
Concurrency & scaling — Concurrency Models, Worker Threads, Child Processes, and Cluster & Scaling.
Testing — The Test Runner, and Mocking, Snapshots & Coverage.
Debugging & diagnostics — Debugging, Profiling & Performance, Memory & Leaks, and Diagnostic Reports, Logging & Observability.
Security — Security Best Practices, The Permission Model, and Crypto, Passwords & Secrets.
TypeScript & tooling — TypeScript in Node.js, and Linting, Formatting & Tooling.
Building applications — Building a REST API, Web Frameworks: Express & Fastify, Authentication & Sessions, Building CLI Tools, Background Jobs, Scheduling & Queues, Email, Feeds & Web Scraping, and Integrating LLM APIs.
Production — Production Deployment, Docker & Containers, Single Executable Applications, and Upgrading & What’s Changed.
Beyond the basics — Native Add-ons, WebAssembly & FFI.