Node.js Fundamentals: Server-Side JavaScript

Node.js Fundamentals is an intermediate-level course of 5 lessons (about 3 h 1 min), with 15 exercises and 15 quiz questions. Prerequisites: Asynchronous JavaScript (Promises, fetch, APIs). Exercises run in the browser, with nothing to install.

  • Server-side JavaScript
  • Intermediate
  • 5 lessons
  • 3 h 1 min
  • 15 exercises
  • Exercises run in the browser

The course in brief

This course takes you from browser JavaScript to server-side JavaScript. You will learn how Node.js works, configuration through the environment, CommonJS and ES modules, npm and semantic versioning, asynchronous programming and the event loop, file handling, events, streams, and finally a native HTTP server, the foundation of every web framework.

What you will be able to do

  • Explain the Node.js execution model and avoid blocking the event loop
  • Write command-line tools configured through arguments and environment variables
  • Organize a project into ES or CommonJS modules and manage its dependencies with npm
  • Write correct asynchronous code with promises, async/await, Promise.all, and timeouts
  • Read and write files safely with node:fs and node:path
  • Use EventEmitter, streams, and the http module to build a first server

Syllabus: 5 lessons

    • Explain what Node.js is and how it differs from browser JavaScript
    • Run a script and read its arguments and environment variables
    • Build a validated configuration from process.env

    Node.js runtimeThe process objectConfiguration through the environment

  1. 02

    CommonJS, ES Modules, and npm

    18 min
    • Organize code into modules with CommonJS and ES modules
    • Configure package.json (type, scripts, dependencies)
    • Understand semantic versioning and the lock file

    ModulesES modulesnpm and package.jsonSemantic versioning

  2. 03

    Async: Callbacks, Promises, and the Event Loop

    20 min
    • Move from callbacks to promises and async/await
    • Run operations in parallel or in series and handle errors
    • Predict the execution order using the event loop

    Asynchronous programmingPromisesEvent loop

  3. 04

    Files and Paths: node:fs and node:path

    18 min
    • Read and write text and JSON files with node:fs/promises
    • Build portable, safe paths with node:path
    • Handle file errors (ENOENT, EACCES) and prevent path traversal

    File systemPathsSystem errors

  4. 05

    Events, Streams, and the Native HTTP Server

    20 min
    • Emit and listen to events with EventEmitter
    • Process data as a flow with streams and pipeline
    • Understand a native HTTP server before moving on to Express

    EventEmitterStreamsThe http module

Final project

A CLI Tool and a Mini Server for Expense Tracking

Build an expense tracker in plain Node.js (built-in modules only): a command `depenses ajouter --montant 12.5 --categorie courses` that saves to a JSON file, a command `depenses rapport --mois 2026-11` that aggregates the amounts, streaming import of a large bank CSV file, and a small native HTTP server exposing `GET /rapport?mois=` as JSON.

Deliverables

  • Source code organized as ES modules, with package.json and npm scripts
  • The CLI built on util.parseArgs, with help messages and correct exit codes
  • The CSV import using streams, tested on a file of more than 100,000 lines
  • The native HTTP server and node:test tests for its request handler

Assessment criteria

  • No blocking synchronous operations in the server
  • File and argument errors are handled with clear messages
  • Configuration (port, data path) is read from the environment
  • The streaming import keeps memory stable regardless of volume
  • The code is split into coherent, tested modules

Frequently asked questions

Do I need to know JavaScript well before learning Node.js?

Yes, you should be comfortable with functions, objects, arrays, and the basics of asynchronous code in the browser (course FE6). Node.js uses the same language, with different APIs.

Which version of Node.js should I use?

Use the current LTS version, Node 26. The course relies on modern built-in features: util.parseArgs, import.meta.dirname, native fetch, the --watch mode, and the --env-file option.

Is Node.js suited to heavy computation?

Node.js excels at I/O-heavy applications, such as APIs and real-time systems. Heavy computation should be moved to worker threads or another service so it does not block the event loop.

Does this course cover Express?

It lays the necessary groundwork and ends with a native HTTP server. Express is covered in detail in the next course of the path, "API with Express".

This course, told for your job

Say what you want to be able to do: “Node.js Fundamentals” takes its place in your path, with examples from your field. The concepts stay those of the course.

The preview is free, and you can take the courses one at a time without paying. The path only contains lessons from the catalogue.