Free through lesson 3

Node.js for Beginners

From setting up your environment through modules, async code, file I/O, HTTP and Express, SQLite, testing and running in production. Fifty lessons that take you to the point where you can assemble a notes API and a CLI yourself and keep them running. Every piece of code and result shown was produced by actually running Node.js v26.7.0.

Curriculum

The 50 lessons are grouped into seven chapters. Working through them in order is the best way, but you are welcome to dip into whatever interests you. Note: this cannot run inside the browser, so try it with your own node (version 22 or later).

Chapter 1 — Getting started (lessons 1–5)

You get to grips with how Node.js runs and set up your environment with a version manager. You cover the different console methods, command line arguments, environment variables and .env, so values can come in from outside.

Chapter 2 — Modules and packages (lessons 6–10)

You split code across files and pull in other people's. You pin down the difference between CommonJS and ES Modules along with the rules that decide which is which, then go on to package.json and semantic versioning in npm.

Chapter 3 — Async code (lessons 11–17)

The high point of the course. You feel the problem with synchronous code by actually freezing the process, then work up through callbacks, promises and async/await. The chapter closes with the event loop and error handling.

Chapter 4 — Files and I/O (lessons 18–26)

From building paths through reading and writing files, working with directories and handling JSON. The second half — streams, EventEmitter, Buffer and readline — lets you push large amounts of data through at constant memory.

18

The path module and building paths

The difference between join and resolve, mixing up __dirname and process.cwd(), and validating before joining user input onto a path.

🔒 Basic
19

Reading files

Why fs/promises is the default. That omitting utf8 gives you a Buffer, that you branch on the error code, and that large files go line by line.

🔒 Basic
20

Writing files

writeFile empties the file the instant it opens it. Making writes unbreakable with a temporary file plus rename, and using a stream for large output.

🔒 Basic
21

Working with directories

Make recursive the default for mkdir. Since readdir's recursive cannot exclude node_modules, write your own walk or use fs.glob.

🔒 Basic
22

Reading and writing JSON files

How require('./config.json') gets cached. What stringify loses, the round-trip problem of Date becoming a string, and adding the filename to a SyntaxError.

🔒 Basic
23

Streams

The mechanism that turns 620MB of memory into 69MB. Why you use pipeline rather than pipe, and the standard form for backpressure.

🔒 Basic
24

EventEmitter

How on and emit work. That emit is synchronous, that only 'error' throws when nobody is listening, and forgetting to remove a listener.

🔒 Basic
25

Buffers and character encodings

Moving between bytes and strings. That subarray is not a copy, why text breaks at a chunk boundary, and three ways to fix it.

🔒 Basic
26

Interactive programs with readline

Asking one question at a time with readline/promises. How forgetting rl.close() hangs everything, and supporting both interactive and piped input.

🔒 Basic

Chapter 5 — HTTP and Express (lessons 27–34)

You write the server, the router and body parsing yourself with the raw http module before moving to Express. Knowing exactly what Express is doing for you, you go on to REST APIs and error design.

Chapter 6 — Storing data and keeping it correct (lessons 35–42)

You move storage from a JSON file to SQLite, separate out configuration, and add validation with zod. The second half gathers the tools that keep your code correct: debugging, testing and linting.

Chapter 7 — Professional tooling and wrapping up (lessons 43–50)

TypeScript, logging, CLIs, child processes, worker_threads, measurement and graceful shutdown. You finish by assembling a notes API and CLI that pull all of it together.

Once you have finished all 50 lessons, add types with TypeScript for Beginners, or connect to the frontend with Next.js for Beginners. Membership unlocks every course.