Namaste Node.js — Complete Tutorial Index

Namaste Node.js — Complete Tutorial Index

Hey everyone! Welcome to Namaste Node.js! 🙏

This is the complete episode-by-episode index for the Node.js series. If you've ever wondered "how does JavaScript run outside the browser?", "what actually IS the event loop?", or "why is Node called non-blocking when JS is single-threaded?" — you're in the right place. We go all the way down: V8, libuv, the thread pool, the event loop — and then back up to build a real server.

No C++ needed, no hand-waving. Every episode is taught the same way: plain-English idea → ASCII picture → real-world analogy → the code → what's really happening under the hood → interview Q&A.

┌─────────────────────────────────────────────────────────────────┐
│               NAMASTE NODE.JS — ROADMAP                         │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  SEASON 1 — MODULES & THE SOURCE   (Episodes 04 – 05)          │
│  SEASON 2 — UNDER THE HOOD         (Episodes 06 – 10)          │
│  SEASON 3 — BUILDING FOR REAL      (Episodes 11 – 12)          │
│  SCALING — BEYOND ONE CORE         (Bonus episode)             │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘
HOW EVERY EPISODE IS TAUGHT:
────────────────────────────
  Idea in plain words  →  ASCII picture  →  Real-world analogy
        →  The code  →  Under the hood  →  Interview Q&A

Legend: ✅ = ready to read


SEASON 1 — Modules & The Source

"Before you use a tool, learn how it's put together."

✅ Episode 04 — Module Export & Require    → Read Episode

What you'll learn:
──────────────────
✔ Why modules exist (and what life was like without them)
✔ module.exports and require() — the two halves of the deal
✔ How Node wraps EVERY file in a function (the IIFE trick)
✔ Why variables in one file don't leak into another
✔ The module cache — why require() runs a file only ONCE
✔ CommonJS vs ES Modules

Key Concept: Every file in Node is a private box until you export from it.

✅ Episode 05 — Diving into the Node.js GitHub Repo    → Read Episode

What you'll learn:
──────────────────
✔ Node.js is just JavaScript + C++ glued together
✔ Where require() actually lives in the source
✔ How a JS call reaches C++ (and comes back)
✔ Reading the source without being scared of it

Key Concept: Node is not magic — it's a C++ program that embeds V8.

SEASON 2 — Under the Hood

"This is the season that makes you dangerous in interviews."

✅ Episode 06 — libuv & Async IO    → Read Episode

What you'll learn:
──────────────────
✔ Sync vs async I/O — drawn as a picture
✔ Who actually does the waiting (spoiler: not your JS)
✔ What libuv is and why Node can't live without it
✔ Blocking the main thread — the #1 Node sin

Key Concept: JS hands the slow work to libuv and walks away.

✅ Episode 07 — sync, async & setTimeout(0)    → Read Episode

What you'll learn:
──────────────────
✔ Why setTimeout(fn, 0) does NOT run immediately
✔ The call stack, drawn step by step
✔ Trusting the timer vs the timer lying to you
✔ Predicting the output order of tricky snippets

Key Concept: setTimeout(0) means "as soon as possible", not "right now".

✅ Episode 08 — Deep Dive into the V8 JS Engine    → Read Episode

What you'll learn:
──────────────────
✔ Parsing → AST → Interpreter (Ignition) → Compiler (TurboFan)
✔ What JIT compilation actually means
✔ Inline caching & hidden classes — why V8 is fast
✔ Garbage collection (Orinoco, mark & sweep)
✔ Why your code gets FASTER the more it runs

Key Concept: V8 starts by interpreting, then optimizes the hot paths.

✅ Episode 09 — libuv & The Event Loop    → Read Episode

What you'll learn:
──────────────────
✔ The event loop's phases, in order (timers → poll → check → close)
✔ Where setTimeout, setImmediate & I/O callbacks each land
✔ process.nextTick and the microtask queue (they cut the line!)
✔ Tracing a full request through every phase

Key Concept: The event loop is a for-loop with phases — nothing more.

✅ Episode 10 — Thread Pool in libuv    → Read Episode

What you'll learn:
──────────────────
✔ Node is single-threaded... but libuv isn't
✔ The 4 default threads (and UV_THREADPOOL_SIZE)
✔ What goes to the pool: fs, crypto, dns.lookup, zlib
✔ What does NOT go to the pool (network I/O — and why)
✔ Starving the thread pool — a real production bug

Key Concept: "Single-threaded" describes your JS, not the whole of Node.

SEASON 3 — Building For Real

"Enough theory. Let's serve some traffic."

✅ Episode 11 — Creating a Server    → Read Episode

What you'll learn:
──────────────────
✔ What a "server" really is (hardware vs software)
✔ Client-server architecture, protocols, DNS & ports
✔ Sockets vs HTTP — the difference that matters
✔ Writing an HTTP server in raw Node (no Express!)
✔ How one server handles many clients at once

Key Concept: A server is just a program listening on a port.

✅ Episode 12 — Databases: SQL & NoSQL    → Read Episode

What you'll learn:
──────────────────
✔ SQL vs NoSQL — the honest comparison
✔ Relational tables vs documents (drawn side by side)
✔ ACID vs BASE
✔ When to pick which (and why "it depends" is a real answer)
✔ Connecting a database to your Node app

Key Concept: Pick the database that matches your data's SHAPE.

SCALING — Beyond One Core

"Your server uses ONE core. Your machine has eight. Let's fix that."

✅ Bonus — The Node.js Cluster Module    → Read Episode

What you'll learn:
──────────────────
✔ Why a single Node process wastes your CPU
✔ cluster.fork() — one worker per core
✔ How the master shares one port across workers
✔ Auto-restarting a crashed worker (zero downtime)
✔ Cluster vs PM2 vs worker_threads — picking the right tool

Key Concept: Cluster runs N copies of your app so all cores do work.

Episode Map

TopicEpisodeStatus
Modules, require, module.exports04✅ Done
The Node.js source code05✅ Done
libuv & async I/O06✅ Done
sync, async, setTimeout(0)07✅ Done
V8 engine, JIT, garbage collection08✅ Done
The event loop & its phases09✅ Done
Thread pool, UV_THREADPOOL_SIZE10✅ Done
Creating an HTTP server11✅ Done
Databases — SQL & NoSQL12✅ Done
Cluster module & multi-core scalingBonus✅ Done

How to Use This Series

1. Go in order — Season 2 only makes sense after Season 1.
2. The event loop (Ep 09) is THE interview question. Read it twice,
   then draw the phases from memory on paper.
3. Episodes 06, 08, 09 and 10 are one single story:
   libuv → V8 → event loop → thread pool. Don't split them up.
4. Say your answers OUT LOUD. "Node is single-threaded" is only half
   an answer — interviewers are waiting for the other half.
5. After Ep 11, go build a tiny server yourself before moving on.

Keep coding, keep shipping! See you in the episodes!