You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
What is Node.js?
What is Node.js?
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.
A Brief History
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:
- Web developers already knew JavaScript, so they could reuse skills on the server
- Its event-driven, non-blocking model proved excellent for I/O-heavy tasks
- The npm package registry grew rapidly into the largest open-source ecosystem in the world
What Node.js Is Used For
Node.js is especially well-suited for:
- Web servers and REST APIs — handling many concurrent requests efficiently
- Real-time applications — chat applications, live dashboards, collaborative tools
- Command-line tools — build tools, code generators, scripts
- Microservices — small, independently deployable services
- Streaming applications — processing large files or media without loading them fully into memory
Large companies including Netflix, LinkedIn, Uber, PayPal, and NASA have adopted Node.js for production workloads.
JavaScript on the Server vs the Browser
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 |
Your First Node.js Program
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.
The Node.js Ecosystem
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.