One language, everywhere
Until 2009 JavaScript lived only in browsers. Node.js took Chrome's JavaScript engine (V8) and let it run on servers and laptops — with access to files, the network and the operating system. Today it powers APIs, build tools (Vite, Next.js), command-line tools and more.
Running a program
console.log("Namaste from Node", process.version);
console.log("Platform:", process.platform);
console.log("Arguments:", process.argv.slice(2));
console.log("Environment:", process.env.NODE_ENV);
const start = Date.now();
setTimeout(() => {
console.log("Done after", Date.now() - start >= 100 ? "≥100" : "<100", "ms");
}, 100);- Install Node from nodejs.org (use an LTS version). Check with node --version.
- node alone opens a REPL to try expressions; node file.js runs a file.
- No DOM: Node code reads files, talks to databases and answers HTTP requests instead.