Courses / Node.js: From First Script to Production
Course · Beta · FreeNode.js: From First Script to Production
Start with the basics in the order most beginner courses use: running Node, globals and modules, async code, events, core modules, a web server, npm, and a REST API on PostgreSQL. Then go deeper: the event loop, microtasks, the thread pool, streams, memory and profiling, then production APIs, security, caching, real-time, tests, TypeScript, observability and deployment. A case study, timed output drills and a mock interview close it.
0 of 27 chapters done · saved on this device
What you will be able to do
- Run, debug and package Node programs, and explain how CommonJS and ES modules load code
- Write correct async code with callbacks, promises, async/await and EventEmitter, and avoid the common bugs
- Build an HTTP server by hand, then a REST API on PostgreSQL with Express, pools and transactions
- Predict the order of timers, immediates, nextTick and promise callbacks, and spot code that blocks the loop
- Stream large files with backpressure, find memory leaks and profile slow endpoints with real numbers
- Validate, secure, test, type, observe and gracefully shut down a production Node service
- Answer Node interview questions with a clear method and score yourself on a timed mock
Who it is for
Students and engineers with up to about five years of experience who know basic JavaScript: freshers preparing for backend roles, frontend developers moving to the server, and engineers who use Node every day and want to explain what happens underneath.
You will need
Basic JavaScript: variables, functions, objects, arrays and arrow functions. Node 22 or later installed; every example was run on Node 24. No backend experience needed.
Pick a path
Curriculum
11 modules · 27 chapters · 14 hModule 1Start here0 of 1 done
How a Node.js interview round runs, what gets scored, a method for answering, and a study plan mapped to this course.
Module 2Node.js basics0 of 2 done
What Node is, how to install and run it, the globals it gives you, and how CommonJS and ES modules find and load code.
- Not started: 02Getting Started: What Node.js Is and Running Your First Script27 min · 2 scenesWhat Node is made of, picking a version, the REPL, running scripts and a first server
- Not started: 03Globals and Modules: process, CommonJS and ES Modules26 min · 2 scenesNode's globals, the process object, and how require and import find, load and cache code
Module 3Asynchronous and event-driven code0 of 2 done
Callbacks, promises and async/await written correctly, then the EventEmitter pattern that most of Node is built on.
- Not started: 04Asynchronous Programming: Callbacks, Promises and async/await29 min · 2 scenesNon-blocking I/O, error-first callbacks, promises, async/await, combinators and async bugs
- Not started: 05Event-Driven Programming with EventEmitter21 min · 1 sceneHow emitters call listeners, the error event, leaks, your own emitters and events as promises
Module 4Core modules and a basic web server0 of 2 done
Files, paths, buffers, crypto and util, a first look at streams, then an HTTP server built by hand with node:http.
- Not started: 06Core Modules: Files, Paths, Buffers, Crypto and util38 min · 2 scenesWork with paths and URLs, files and folders, buffers, a first stream, os, crypto and util, with real runs.
- Not started: 07Building a Basic Web Server with node:http36 min · 2 scenesBuild a web server by hand: requests, routing, JSON bodies, static files, timeouts and fetch.
Module 5Packages, databases and advanced topics0 of 3 done
npm and lockfiles, a REST API on PostgreSQL with Express, then child processes, worker threads, cluster and debugging.
- Not started: 08npm and Package Management: Dependencies, Versions and Lockfiles32 min · 1 sceneUse npm well: package.json, semver ranges, lockfiles, scripts, supply-chain safety and publishing.
- Not started: 09Working with Databases: A REST API on PostgreSQL35 min · 2 scenesBuild an orders API with Express and PostgreSQL: pools, parameterised SQL, transactions and errors
- Not started: 10Advanced Topics: Child Processes, Worker Threads, Cluster and Debugging32 min · 2 scenesRun other programs safely, move CPU work to workers, use every core, and debug with the inspector
Module 6Inside the runtime0 of 4 done
The event loop phase by phase, the microtask queues, the libuv thread pool and streams with backpressure.
- Not started: 11Inside the Event Loop: Phases, Timers and setImmediate28 min · 2 scenesThe loop's phases, what lands in each, why setTimeout and setImmediate race, and loop health
- Not started: 12process.nextTick, Promise Jobs and the Microtask Queue22 min · 2 scenesWhen nextTick and promise jobs run, how ES modules change it, and how microtasks starve the loop
- Not started: 13The libuv Thread Pool and Blocking Work23 min · 2 scenesWhat runs on libuv's threads, what blocks the loop, how to measure it and how to fix it
- Not started: 14Streams in Depth: Custom Streams, Backpressure and Pipelines30 min · 2 scenesWrite your own streams, keep memory bounded with backpressure, and clean up errors with pipeline
Module 7Memory and performance0 of 2 done
How V8 compiles and collects garbage, how to find a leak, and how to profile and load-test a slow endpoint.
- Not started: 15V8 Memory, Garbage Collection and Leaks32 min · 2 scenesV8's tiers, the generational heap, heap limits, four common leaks, heap snapshots and weak references
- Not started: 16Profiling Node: CPU Profiles, Flame Graphs and Load Tests25 min · 2 scenesMeasure first, read CPU profiles, load-test with percentiles, watch loop utilisation, fix a slow endpoint
Module 8Production services0 of 4 done
APIs that validate and fail clearly, authentication and security, caching and background jobs, and real-time connections.
- Not started: 17Production APIs: Validation, Error Shapes, Idempotency and Fastify38 min · 2 scenesValidate at the edge, return problem details, page with cursors, dedupe retries, try Fastify
- Not started: 18Authentication, Authorisation and Securing a Node App48 min · 2 scenesHash passwords, run sessions and JWTs, check ownership, block injection, SSRF and traversal, harden the app
- Not started: 19Caching and Background Jobs in Node Services36 min · 2 scenesIn-process and Redis caches, stampede protection, rate limits, and jobs that retry safely
- Not started: 20Real-Time Node: Server-Sent Events and WebSockets26 min · 2 scenesPush with SSE and WebSockets, keep connections healthy, and fan out across processes
Module 9Tests, types and operations0 of 4 done
The built-in test runner, TypeScript in Node, logs, metrics and traces, and scaling and deploying without dropping requests.
- Not started: 21Testing Node Code with node:test28 min · 1 sceneWrite fast, reliable tests with the built-in runner: fakes, mocks, fake timers, API and coverage
- Not started: 22TypeScript for Node: Type Stripping, tsconfig and Typed Handlers28 min · 1 sceneRun TypeScript on Node: type stripping, tsconfig, building, schema-checked handlers and library types.
- Not started: 23Observability: Structured Logs, Metrics and Traces25 min · 1 sceneSee inside a running Node service with JSON logs, request ids, Prometheus metrics, probes and traces
- Not started: 24Scaling and Deploying: Statelessness, Graceful Shutdown and Containers33 min · 2 scenesRun many instances safely: stateless code, graceful shutdown, production mode, containers, rolling deploys
Module 10Case study and drills0 of 2 done
A food-delivery orders service built end to end, then timed predict-the-output drills on the event loop and async code.
- Not started: 25Case Study: A Food-Delivery Orders Service, End to End37 min · 3 scenesBuild an orders service: idempotent orders, a cached menu, background receipts, tests and a clean shutdown
- Not started: 26Predict the Output: Timed Event Loop and Async Drills21 min · 1 sceneSixteen predict-the-output puzzles on timers, ticks, promise jobs, I/O callbacks, emitters and errors
Module 11Mock interview0 of 1 done
Five timed prompts covering runtime knowledge, live coding, debugging and design, with model answers and a rubric.
How this course is made
Written by the aiiolar team. Every chapter is fact-checked by a second reviewer, checked against a shared set of numbers so chapters agree, and checked for originality before it goes up. Found a mistake? Tell us and we fix it within a week.
Questions
Do I need backend experience?
No. You need basic JavaScript. The nine basics chapters start from running a script and build up to a REST API on PostgreSQL.
Which Node version does the course use?
Everything targets Node 22 and later, and every example was run on Node 24. Where a feature needs a particular version, the lesson says which.
Is the output of every example real?
Yes. Every snippet that shows output was run, and the page shows what Node printed. Where an order or a timing is not guaranteed, the lesson says so and shows one real run.
How long is a lesson?
Five to ten minutes. Each lesson explains one idea, shows how it works, runs code, and ends with two or three quiz questions.
Do I need PostgreSQL, Redis or Docker installed?
No. The database lessons run real PostgreSQL inside Node with PGlite, so there is nothing to install. Where a lesson shows Redis or a Dockerfile, it says how the example was checked.
Does it cover TypeScript and testing?
Yes. One chapter covers running TypeScript in Node, tsconfig and typed handlers, and another covers the built-in test runner, mocks, fake timers and API tests.
How does it help with interviews?
The first chapter explains how Node rounds usually run, what gets scored and how to structure an answer. The last two give timed predict-the-output drills and a five-prompt mock with model answers and a rubric.