Node.js

Node.js

Node.js is a piece of software that lets you run programs written in the language JavaScript outside the browser. This makes it possible to write servers, tools, and entire web services in the same language used for the display in the browser.

JavaScript is the language in which web pages are programmed. For a long time it ran exclusively in the browser, that is, in the program used to view pages. Node.js changes that: it is a piece of software that runs JavaScript directly on a computer, without a browser. This means the language can also be used to write programs that run in the background on a remote machine and deliver data. Node.js appeared in 2009 and is free and open source, so anyone may use it and inspect the program code. Today, a large share of the services on the internet run on it.

One language for the whole application

Before Node.js, a web project usually needed two languages. JavaScript ran in the browser, while the remote machine ran something like PHP, Java, or Python instead. So a team had to master both or split up the work. Node.js makes this separation unnecessary, because both sides can speak the same language.

That saves time and lowers costs. Small building blocks can be shared between both sides, such as the rules for checking a login form. Startups especially value this, because they need a finished product quickly with only a few people. Large companies like Netflix, PayPal, and LinkedIn have switched parts of their systems to Node.js.

On top of that, there is a huge supply of ready-made code. Through the package manager npm, more than two million free program building blocks are available. Anyone who needs a payment function or an email dispatch rarely writes it by hand. This selection is a main reason for the widespread use of Node.js.

Waiting without standing still

At the core of Node.js is V8, the JavaScript engine from the Chrome browser. It translates the written code into instructions that the processor understands directly. That is why Node.js is surprisingly fast for a scripting language. Around this core sit additional functions not available in the browser, such as access to files and the network.

The real distinguishing feature is the way it works. Node.js basically uses only a single thread of execution, so it does not distribute the work across many parallel processes. Nevertheless, it can serve thousands of requests at the same time. The trick: when a task has to wait for something, such as a database, Node.js sets it aside and continues with the next one. Once the result is available, the task is picked up again.

A waiter who takes orders and moves on instead of waiting next to the kitchen can serve many tables alone this way. This is exactly what makes Node.js strong when handling many small requests. The downside shows up with long computing tasks: anyone who blocks the single thread for minutes brings all other users to a halt. For heavy computations, other languages are therefore often used instead.

Where Node.js works in the background

Anyone using an app like Uber or a chat is very likely talking to a Node.js program. It receives the request, fetches data from a database, and sends a response back. Live features also often run on it, such as instant messages or constantly updated rates. Such connections stay open for a long time, and this is exactly where Node.js excels.

For programmers, Node.js is also a toolbox. Many helper programs used to build and test web pages run on it. Even those who do not ship any Node.js in the end usually have it installed on their machine.

In business news, the name usually appears in job postings and acquisitions. Knowledge of Node.js is among the most common requirements for web developers. It also plays a role in AI services: the programs that forward requests to a language model and distribute responses to users are often built with it. So Node.js does not do the computation with the model itself, but organizes the path to it.

Subscribe free. Unsubscribe the second it sucks.

High-signal news across AI, business, UX, and tech. Every morning.