Node.js & Express Basics What is Node.js?
1 / 8
Next
What is Node.js? ~10min

What is Node.js?

Node.js is a JavaScript runtime built on Chrome's V8 engine. It lets you run JavaScript outside the browser — on a server, your terminal, or anywhere.

Why Node.js?

  • Same language everywhere — JavaScript on frontend AND backend
  • Non-blocking I/O — handles thousands of concurrent connections efficiently
  • npm ecosystem — over 2 million packages available
  • Used by Netflix, LinkedIn, Uber, Airbnb

How it works — Event Loop

// Node handles async without blocking:
const fs = require("fs");

fs.readFile("big-file.txt", (err, data) => {
  console.log(data);  // called when ready
});

// This runs IMMEDIATELY while file loads in background:
console.log("Reading file... not blocked!");

Your first Node program

// hello.js
const name = "World";
console.log(`Hello, ${name}!`);

// Run: node hello.js
Preview