You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Node.js is a free, open-source, cross-platform JavaScript runtime environment that lets developers run JavaScript code outside a web browser. Before Node.js existed, JavaScript was confined to the browser. Node.js changed that permanently.
JavaScript was created in 1995 to run inside browsers. For over a decade it lived exclusively there. In 2009, Ryan Dahl released Node.js by embedding Google's V8 JavaScript engine — the same engine that powers Chrome — into a C++ program and exposing low-level operating system APIs to JavaScript code. Suddenly, JavaScript could read files, open network sockets, and talk to databases, just like Python or Java.
Node.js became popular quickly because:
Node.js is especially well-suited for:
Large companies including Netflix, LinkedIn, Uber, PayPal, and NASA have adopted Node.js for production workloads.
Running JavaScript in Node.js is different from running it in the browser:
| Feature | Browser | Node.js |
|---|---|---|
| DOM / window | Available | Not available |
| File system | Not available | Available via fs module |
| HTTP server | Not available | Available via http module |
| Module system | ES Modules | CommonJS + ES Modules |
| Global object | window | global / globalThis |
After installing Node.js from nodejs.org, you can run a JavaScript file directly from the terminal:
// hello.js
console.log("Hello from Node.js!");
node hello.js
# Hello from Node.js!
The node command invokes the Node.js runtime, which reads the file, compiles it with V8, and executes it. There is no browser involved — this runs entirely on your machine or server.
Node.js ships with a standard library (called core modules) covering file I/O, networking, streams, cryptography, and more. Beyond that, the npm registry hosts over two million packages that you can install and use in seconds.
Understanding Node.js opens the door to server-side development, full-stack JavaScript, build tooling, and a huge category of modern software. This course walks you through the fundamentals step by step.