Level 1 · Entry Foundations¶
Goal: understand what the node binary actually does with your code, and get fluent with
the built-in modules every backend relies on — before any framework enters the picture.
By the end of this level you will have written a dependency-free JSON API on node:http
and shipped an installable command-line tool.
The level deliberately stays close to the metal. When Express shows up in Level 2 you
should recognize req, res, body parsing, and routing as conveniences over things you
already built by hand.
Modules¶
- What Node.js Is: V8 + libuv — the runtime's two engines, the single JavaScript thread, and the hidden thread pool
- Installing Node & Managing Versions — LTS vs Current, nvm/fnm,
.nvmrc, andengines - Modules: ES Modules & CommonJS — how Node picks a module system, interop both ways, and module resolution
- npm & package.json — dependencies, semver, the lockfile, scripts, and how
node_modulesis laid out - Files & Paths: fs and path — promise-based fs, error codes, atomic writes, and path safety
- Async Patterns: Callbacks to async/await — a Node-focused refresher: promisify, parallelism, cancellation, unhandled rejections
- Events & EventEmitter — synchronous dispatch, the
'error'event, and async iteration over events - A Raw HTTP Server with node:http — routing, body parsing, and status codes with zero dependencies
- Environment Variables & Configuration —
process.env,--env-file, and a fail-fast config module - Project — A Real CLI Tool —
logstat, a streaming access-log analyzer with flags, exit codes, and tests
What you need before starting¶
- Working knowledge of modern JavaScript:
const/let, arrow functions, destructuring, classes, template literals, and the basics of promises. The JavaScript Mastery Path covers these if you need them. - A terminal you are comfortable in, and
curlfor poking at HTTP servers. - A current Node release (lesson 02 shows how to install one). All code uses ES modules.
Keep the logstat project from module 10 — its structure (pure logic in src/, I/O at
the edges, tests beside it) is the same shape you will use for the API in Level 2.