Web Dev Academy Backend languages · Node.js Tool 37 / 64
Backend languages

Node.js

JavaScript, off the browser. Node runs JS on the server with a non-blocking event loop, letting one process juggle thousands of connections at once.

Demo 01

Spin up a server in 6 lines

Node's built-in http module is all you need to answer requests. Click Run to "start" the server — the terminal below is a simulation (the JS is real, but real Node runs on a server, not in your tab).

const http = require('node:http');

const server = http.createServer((req, res) => {
  res.writeHead(200, { 'Content-Type': 'application/json' });
  res.end(JSON.stringify({ ok: true, msg: 'Hello from Node' }));
});

server.listen(3000, () => console.log('Listening on :3000'));
bash — node server.js
$ press Run to start the server…
Demo 02

Send a request, get JSON back

With the server "running", fire requests at it. The route handler responds with real JSON — exactly how a Node API feels in practice (simulated client + server, all in JS).

// response will appear here

The server must be running (Demo 01). 200 = found, 404 = no such route.

Demo 03

The event loop, visualised

Node never waits. Synchronous code runs first, then timers, then I/O callbacks. Click Run to watch the runner sweep the phases and log lands in the famous "non-blocking" order.

console.log('1 · sync');
setTimeout(() => console.log('4 · timer'), 0);
Promise.resolve().then(() => console.log('3 · microtask'));
console.log('2 · sync');
timers
pending
poll (I/O)
check
close
// output appears here
Demo 04

Why one thread handles thousands

Because Node doesn't block on I/O, a single process can hold many open connections cheaply. These numbers describe Node's real-world profile.

~1
main thread doing your JS
10k+
concurrent connections per process
libuv
C library powering the event loop & thread pool
V8
Chrome's engine compiling your JS
Demo 05

npm: the package universe

Node ships with npm. Type a package and "install" it — a simulated install log shows the experience of pulling code from the registry.

bash — npm
$ ready
i
The code shown is real Node.js (the http module, the event-loop snippet, npm). But Node executes on a server, not in a browser tab — so the terminal, the request/response console, the event-loop animation and the install log are an interactive simulation written in vanilla JavaScript. The shared CSS shell provides the page styling.

↑ All 64 tools