Skip to content
BENIBIX Learn

Node.js

Development⚙️ Compilers & RuntimesRuntimes

Also known as Node, NodeJS

A tool that runs JavaScript outside the browser. Servers use it a lot.

Think of it like

Think of it like taking a fish out of its tank and giving it legs. Now it can walk on land too.

Example

Node.js was created by Ryan Dahl and first released in 2009. Jack uses it to run his shop's server and his build tools.

Why it matters

It lets you use one language for both the page and the server. Most web build tools run on it.

Definition

Node.js is a program that runs JavaScript outside the browser. Before it, JavaScript could only run inside web pages. It is built on the same engine that runs JavaScript in Chrome. It handles lots of users at once. It never sits still while it waits. It comes with npm, the largest store of code packages in the world.

Example code

console
$ node -e 'console.log(1 + 1)'
2
Node.js runs one line of JavaScript and prints the answer.

Common mistake

Running slow, heavy maths on the main thread. It blocks every other user until it ends.

Key takeaways

  1. 1
    JavaScript off the page. On servers and laptops.
  2. 2
    Never sits idle. Handles many users at once.
  3. 3
    Comes with npm. A huge store of packages.

Compare