Web DevelopmentIntermediatejavascript

Node.js & Express

The Node runtime, its event loop, and building a JSON API with Express — pinned to Node 22 and Express 5.

Node.js is a JavaScript runtime, and most of the surprises in it come from the word runtime. There is no browser, there is no DOM, and the code shares one thread with the operating system. A program that reads a file is not asking V8 to go do it - it is asking the thread pool, and the event loop is the machine that waits for the answer. Most 'why is my server slow' stories start at exactly that sentence. This course pins its claims to Node 22 LTS and Express 5, which became the default on npm in 2025. Those versions changed several of the things older tutorials still teach: in Express 5 a rejected promise inside a handler is forwarded to your error middleware automatically, the classic `*` wildcard no longer compiles, and query strings are parsed with the simple parser unless you opt into `qs`. Each of those is a breaking change that produces a confusing error rather than a clear one, so each gets its own treatment here. The practice is prediction-based. The sandbox can run plain JavaScript but not an Express server, so the questions ask what Node will do with a given program: what order callbacks fire, what a handler returns, whether a request reaches the route you think it does. Every prediction states the version and the default it depends on, because in a runtime as version-sensitive as Node a prediction without a version is not an answer.

4.6 (120) 1,240 students 249 min 18 lessons 220 XP on completion

What you will be able to do

  • Trace a Node program's flow through the event loop: timers, the microtask queue, process.nextTick and setImmediate, and what blocks them all
  • Read and write CommonJS and ESM modules, and predict which module system a file resolves to from its extension and package.json
  • Map a request onto an Express route and its middleware chain in registration order, including params, query and a JSON body
  • Predict how Express 5 handles a throwing handler and where the error lands, and place the four-argument error middleware correctly
  • Decide when a 400, 404, or 422 is the honest answer, and when an async error must become a 500 before it ever reaches the client
  • Choose a connection pool over per-request clients and parameterise every query that touches user input

Assessments

Dashboard