Skip to content

What Is Node.js

You already know JavaScript. Node.js is JavaScript running outside the browser — on a server, in a terminal script, or in a build tool. The same language you use to build React UIs is the one you’ll use to build the API that powers them.

Every time you’ve written JavaScript so far, it has run inside a browser. The browser provides the environment: document, window, fetch, localStorage, and the event system that connects JS to the DOM.

Node.js provides a completely different environment. There is no document, no DOM, no browser at all. Instead, Node.js gives you:

  • The file system — read and write files on disk
  • The network — create HTTP servers, make requests
  • Processes — run commands, manage child processes
  • Streams — handle large data efficiently

Same language, completely different capabilities.

Node.js is what makes JavaScript a full-stack language. Before Node.js (released 2009), you needed JavaScript in the browser and a different language (PHP, Ruby, Python, Java) on the server. Node.js eliminated that split for teams that want to use JavaScript everywhere.

Today, Node.js powers:

  • REST APIs and GraphQL servers
  • Real-time applications (chat, notifications)
  • Build tools (Vite, Webpack, ESLint all run on Node.js)
  • Serverless functions (AWS Lambda, Vercel, Netlify)

Node.js is built on V8 — the same JavaScript engine that runs inside Chrome. When you write node script.js, V8 compiles and executes your JavaScript. The difference from Chrome is everything around V8: instead of DOM APIs, Node.js wraps V8 with APIs for the file system, network, and operating system.

What makes Node.js different from other servers

Section titled “What makes Node.js different from other servers”

Traditional servers (Apache, Nginx running PHP) use a thread-per-request model: each incoming request gets its own thread. Threads are expensive — they consume memory and have a limit.

Node.js uses a single thread and an event loop. All I/O (reading files, querying databases, waiting for network responses) is non-blocking — Node.js kicks off the operation and moves on, coming back to handle the result when it’s ready. This makes Node.js extremely efficient for I/O-heavy workloads like APIs.

You’ll understand this in depth in the next lesson.

Throughout this course you will build Bulletin — a full-stack community board with user accounts, posts, comments, and upvotes. By the final module:

  • The backend: a Node.js + Express + SQLite API deployed to Railway
  • The frontend: a React app deployed to GitHub Pages
  • The two connected: the React app talks to your real live API

No code yet. Answer in your own words:

  1. What does Node.js give you that a browser JavaScript environment does not?
  2. Why is Node.js efficient for building APIs compared to thread-per-request servers?
  3. Name two things you already use that run on Node.js without realizing it.
  • Node.js is JavaScript running outside the browser — on a server or in scripts.
  • It provides access to the file system, network, and OS instead of the DOM and browser APIs.
  • It’s built on V8, the same engine that powers Chrome.
  • It uses a single-threaded event loop with non-blocking I/O — efficient for API servers.
  • This course builds Bulletin: a full-stack app with a Node.js API on Railway and a React frontend on GitHub Pages.