After this lesson, you will be able to: Explain Node.js, its event loop, and why it dominates I/O-heavy workloads.
Node = V8 + libuv + a JS-friendly API. Single-threaded event loop; libuv pool for blocking I/O.
This is a free introductory lesson. No purchase required.
Same language client + server. Lightning-fast iteration. npm ecosystem. Built for async I/O, perfect for web servers + tools + scripts. Drawbacks: single-threaded for JS (GIL-like). CPU-heavy = worker_threads or spawn out.
Phases: timers (setTimeout) → pending callbacks → idle → poll (I/O) → check (setImmediate) → close callbacks. Microtasks (Promise.then) drain between each phase. process.nextTick is HIGHEST priority, fires before any microtask. Use sparingly.
Install Node 20+; run with `node script.mjs` for ESM.
// hello.mjsimport { readFile } from "node:fs/promises";const data = await readFile("./package.json", "utf-8");console.log(JSON.parse(data).name);// node hello.mjs, runs the script with top-level await
Bun: drop-in faster Node alternative; native TS; bundler + test runner included. Deno: built by Node's original creator; secure-by-default; standalone TS; non-npm by default but supports npm. Node is still the default in 2026; Bun + Deno are credible for new projects.
Pick the cleanest answer.