What Is Node.js, and What Is It Good At?
Node.js runs JavaScript outside the browser on the V8 engine. Learn what it is, how its event loop works, where it shines, and where another tool fits better.

Node.js is a runtime that lets you run JavaScript outside a web browser. You write a file, run node file.js, and the code executes on your computer or a server, with access to the file system, the network and the operating system, things a browser deliberately keeps from web pages. It is built on V8, the same JavaScript engine that powers Chrome, wrapped with a library for asynchronous input and output and a standard library of modules. This post explains what that means in practice on Node.js 24: what is inside the runtime, why its design suits some jobs very well, where it is a poor fit, and how to run your first script. Samples show their output.
If you want the internals next, Node.js architecture: V8, libuv and the event loop explained goes deeper, and the event loop phases covers the loop in order.
What it is, and what it is not
Node.js is not a language and not a framework. The language is JavaScript, defined by the ECMAScript standard. A runtime is the program that executes the language plus the things around it. A browser is one runtime, which adds document, window and fetch. Node.js is another, which adds fs, http, process and Buffer, and leaves out the page.
That difference matters when you read code. document.getElementById does not exist in Node.js, because there is no page. require("fs") or import fs from "node:fs" does not exist in a browser, because a page should not read your disk. The language itself, with its functions, classes, promises and modules, is the same in both.
The pieces inside
Three parts do most of the work.
V8 compiles and runs your JavaScript. It is a just-in-time compiler, which means it turns hot code into machine code while the program runs.
libuv is a C library that gives Node.js a cross-platform event loop and asynchronous file, network and timer operations. It is what lets one thread wait on thousands of connections.
The standard library is the set of built-in modules:
node:fsfor files,node:httpfor servers,node:cryptofor hashing and encryption,node:testfor tests, and many more. Most are thin JavaScript wrappers over C++ bindings.
You write JavaScript. When you call readFile, that call crosses into the C++ layer, libuv does the work without blocking your code and a callback or promise brings the result back.
Your first script
Create a file and run it.
const name = process.argv[2] ?? "world";
console.log(`Hello, ${name}!`);
console.log(`Running on Node.js ${process.version.split(".")[0]}`);Run node hello.mjs Ada in a terminal.
Hello, Ada!
Running on Node.js v24process.argv holds the command-line arguments, and process.version the runtime version. The sample prints only the major version, so the line matches any 24.x release. No install step, no build, no framework: one file and the node command.
The model: one thread, many waits
The key idea is how Node.js handles waiting. Much of what servers do is wait: for a disk read, a database reply, an HTTP response from another service. A thread-per-request design dedicates a thread to each of those waits, and threads are costly in memory and scheduling.
Node.js runs your JavaScript on a single main thread and hands waits to the operating system. When the answer arrives, the event loop runs your callback. While the wait is in progress, the thread is free to handle other work.
import { setTimeout as sleep } from "node:timers/promises";
async function task(name, ms) {
await sleep(ms);
console.log(`${name} finished after ${ms}ms`);
}
console.log("starting");
await Promise.all([task("a", 30), task("b", 10), task("c", 20)]);
console.log("all done");starting
b finished after 10ms
c finished after 20ms
a finished after 30ms
all doneThree tasks wait at the same time on one thread. The total is about thirty milliseconds, not sixty, because the waits overlap. That is concurrency without parallel threads, and it is the reason a single Node.js process can serve a large number of mostly-waiting connections.
What it is good at
Network services and APIs. Web servers, REST and GraphQL APIs, WebSocket servers and proxies spend most of their time waiting on sockets and databases, which is exactly the workload above. Frameworks such as Express, Fastify and Hono run on it.
Real-time applications. Chat, notifications and live dashboards keep many connections open and push small messages. A single-threaded event loop with cheap idle connections handles that well.
Command-line tools and scripts. Node.js starts quickly, has first-class file and process APIs and has a huge package registry. Many developer tools you already use, including bundlers, linters and test runners, are Node.js programs.
Tooling and build pipelines. Front-end build tools, code generators and task runners benefit from sharing a language with the code they process.
Sharing code with the browser. Validation rules, types and utility functions can be written once and used on the client and the server.
What it is not good at
The single main thread is also the limit. If your code spends a long time computing, nothing else on that thread runs.
const start = Date.now();
let count = 0;
while (Date.now() - start < 50) {
count += 1;
}
console.log(count > 0);trueFor those fifty milliseconds, a server running this code could not answer any other request. Heavy CPU work such as video encoding, image processing in bulk, large numerical simulations and machine-learning training can starve the loop. Options are worker threads, which run JavaScript on other threads within one process, child processes, or a service in a language better suited to the job. Node.js also has no built-in answer for strict real-time guarantees, and its memory use per process is higher than a small compiled binary, which matters for tiny embedded targets.
The ecosystem
Node.js ships with npm, the package manager, and its registry holds millions of packages. That is a strength, since most problems have a library, and a risk, since each dependency is code you run and a supply-chain link you trust. Prefer the standard library when it does the job: modern Node.js includes a test runner, a watch mode, an .env loader, fetch, a WebSocket client and a SQLite module, which removes several common dependencies.
Versions and support
Node.js releases a new major version every six months, and even-numbered versions become long-term support, or LTS, releases that get fixes for about thirty months. For production, use an LTS release, such as 24, and plan upgrades before support ends. The release schedule lists the dates, and the version appears in your package.json through the engines field, which documents what you support.
How it compares
Compared with Python or Ruby web stacks, Node.js usually gives better handling of many concurrent connections, since its I/O model is built around that. Compared with Go or Java, it offers faster iteration and a shared language with the front end, at the cost of weaker CPU-bound performance and fewer built-in concurrency tools for parallel work. Compared with Deno and Bun, which are other JavaScript runtimes, Node.js has the largest ecosystem and the longest track record, and the others make different choices on built-in tooling and defaults. For most teams, the deciding factors are the existing skills, the libraries needed and the hosting available.
When to pick it
Choose Node.js when your work is mostly I/O: APIs, integrations, real-time features and tools, especially if your team already writes JavaScript or TypeScript. Look elsewhere, or add workers, when the core of the job is heavy computation, when you need very small memory footprints or when you depend on a library ecosystem that lives in another language.


