ENES

Node.js

A way to run JavaScript on servers and computers, outside the browser.

Requests arrive on the left, an event loop in the middle hands slow tasks to a database, files and an API on the right and keeps going

For its first years, JavaScript lived only inside web browsers. Node.js, released by Ryan Dahl in 2009, took Google Chrome's JavaScript engine, called V8, and wrapped it so it could run on any computer, with access to files, the network and everything a server needs. Suddenly the same language could run both the frontend and the backend.

Node.js is built around an event loop. Instead of waiting for a slow task, like reading a file or querying a database, it starts the task, moves on to other work and comes back when the result arrives. That makes a single Node.js process good at juggling many connections at once, which suits APIs, chat apps and real-time tools. It is a poor fit for heavy number-crunching, which blocks the loop for everyone.

Node.js also brought npm, the package manager and registry where developers share ready-made code. Today most web tooling runs on Node.js, even for teams whose servers use another language: build tools, test runners and frameworks like Next.js are installed and run with it.

Keep in mind

Go deeper

Related terms

More in Software