What is Node.js?
Node runs JavaScript outside the browser, on the server. Its defining trait is a single-threaded event loop that handles many connections at once by never blocking on I/O. You already know the language from the frontend; Node adds the runtime, the module system, and a standard library for files, networks, and processes.
Why it matters
Node is the most common backend runtime for teams that already use JavaScript, and it is the lane this track follows. Understanding its async model is the difference between a service that handles thousands of connections and one that freezes under light load. Almost every later topic assumes you are comfortable here.
What to learn
- The event loop, the call stack, and the task and microtask queues
- CommonJS vs ES modules, and
importvsrequire - Async patterns: callbacks, promises, and async/await
- Core modules:
fs,path,http,process,events - Streams and buffers for large data
- Reading config from
process.env - The npm ecosystem and
package.jsonscripts
Common pitfall
Blocking the event loop with synchronous work — a heavy loop, fs.readFileSync,
or JSON parsing of a huge payload in a request handler. While that runs, the
single thread serves nobody else. Keep request handlers async and push heavy
CPU work to worker threads or a queue.
Resources
Primary (free):
- Node.js — Introduction & guides · docs
- Node.js — The event loop · docs
- MDN — Express/Node intro · docs
Practice
Build a small CLI in Node that reads a JSON file with fs/promises, transforms
the data, and writes a new file. Make every file operation async with
await, handle a missing-file error gracefully, and read the input path from an
environment variable. Done when it never uses a synchronous file call.
Outcomes
- Explain how the event loop serves many requests on one thread.
- Choose between callbacks, promises, and async/await correctly.
- Use the core
fs,path, andprocessmodules without a framework. - Identify code that blocks the event loop and move it off the hot path.