Node.js explained: the JavaScript that runs server-side
What Node.js is, why it changed web development, how its non-blocking model works, and when to choose it (or not) over PHP.
In 2009, a developer (Ryan Dahl) had a simple idea with far-reaching consequences: what if we ran JavaScript outside the browser? That is Node.js. Today, it powers a large share of modern web applications.
The original idea
Until then, JavaScript lived only in the browser (to make pages interactive). Node.js takes Chrome’s V8 engine — the one that runs that JavaScript very fast — and pulls it out of the browser to use it server-side.
The result: you can write an entire website, from server to interface, in a single language. For web teams, that’s a huge benefit.
The non-blocking model (the real strength)
Most traditional servers handle requests one by one: if one is waiting on the database, the others wait too.
Node.js works differently, with a non-blocking event loop: while one request waits for a response (database, file, network), Node moves on to the next one. As a result, it handles thousands of simultaneous connections with few resources.
That’s why Node excels at:
- APIs (which answer many small requests),
- real time (chat, notifications, games, live dashboards).
The ecosystem: npm
Node comes with npm, the package manager: the largest catalog of libraries in the world. Need a calendar, an authentication system, a payment client? There is almost always a package for it. That’s what makes development fast.
You often add on top of it:
- a server framework: Express, Fastify, or NestJS;
- an interface framework: React, Vue, Svelte — sometimes combined into “full-stack” tools like Next.js or Nuxt.
Node vs PHP: two philosophies
| PHP (LAMP) | Node.js | |
|---|---|---|
| Execution | On every request (starts then finishes) | Persistent process (always alive) |
| Strength | Content management, WordPress ecosystem | API, real time, full-JavaScript |
| Language | PHP server-side, JS client-side | JavaScript everywhere |
Neither is “better” in absolute terms: they answer different needs. See also our comparison of static / dynamic / application.
When (not) to choose Node
- Choose Node for an interactive application, an API, a real-time product, or if your team is already JavaScript.
- Avoid Node for a simple brochure site: a static site will be simpler, faster and cheaper.
The point isn’t fashion, but the fit between the tool and the need.
Test your knowledge
Node.js lets you use JavaScript…
Before 2009, JavaScript lived in the browser. Node.js brought it to the server, thanks to Chrome's V8 engine.
Node.js's model is described as…
Node handles many connections in parallel without blocking them, which makes it efficient for APIs and real-time use.
npm is…
npm provides access to the largest ecosystem of libraries in the world — hence how fast development with Node can be.
Where does Node.js shine in particular?
Its non-blocking model excels when many clients are connected at the same time.
Key difference with PHP:
PHP starts and finishes on every request; Node keeps a living process that handles requests as they come.