Node.js
Node.js is a JavaScript runtime built on Chrome's V8 engine. It lets you run JavaScript outside the browser β on servers, in terminals, in the cloud β making JavaScript a true full-stack language.
With its event-driven, non-blocking architecture and the world's largest package ecosystem, Node.js is the backbone of modern web backends, CLI tools, serverless functions, and real-time applications worldwide.
// server.js β a simple HTTP server
const http = require('http');
const server = http.createServer((req, res) => {
const routes = {
'/': 'Welcome to Node.js!',
'/hello': 'Hello, World!',
'/json': JSON.stringify({ status: 'ok', lang: 'Node.js' }),
};
const body = routes[req.url] ?? 'Not Found';
const status = routes[req.url] ? 200 : 404;
res.writeHead(status, { 'Content-Type': 'text/plain' });
res.end(body);
});
server.listen(3000, () => {
console.log('Server running on http://localhost:3000');
});What Node.js is used for
Why learn Node.js?
The runtime that brought JavaScript to the server.
JavaScript Everywhere
Node.js lets you use JavaScript on the server. One language across frontend and backend β less context switching, shared code, and a unified team.
Non-Blocking I/O
Node.js uses an event-driven, non-blocking I/O model. It handles thousands of simultaneous connections without creating a new thread for each β that's what makes it fast.
npm β World's Largest Registry
npm gives you access to over 2 million packages. Authentication, databases, email, payments, PDF generation β there is a package for everything.
Perfect for APIs
Node.js with Express or Fastify lets you build REST and GraphQL APIs in minutes. It is the go-to stack for startups and scale-ups building backend services.
Real-Time Applications
WebSockets and Socket.io are first-class citizens in Node.js. Chat apps, live dashboards, multiplayer games, collaborative tools β Node handles them all.
Cloud Native
AWS Lambda, Google Cloud Functions, Vercel, Netlify β Node.js is the default runtime for serverless and edge functions across every major cloud platform.
What you will learn
6 modules from Node fundamentals to building a real REST API.
Node.js Basics & Modules
require(), module.exports, built-in modules like fs, path, and os.
Async JavaScript
Callbacks, Promises, async/await β mastering asynchronous code in Node.
HTTP & Express
Building web servers with the built-in http module and Express.js.
Working with Files
Reading, writing, and streaming files with the fs and stream modules.
npm & Package Management
Installing packages, managing dependencies, scripts, and package.json.
REST API Project
Build a complete REST API with Express, routing, middleware, and JSON responses.
Ready to run your first Node.js server?
Start with the fundamentals and build up to writing real APIs and backend services.
The Story of Node.js
Real history, real companies, and an honest look at where Node.jsshines and where it doesn't β not just a feature list.
Where it came from
Node.js was created by Ryan Dahl in 2009, built on Chrome's V8 JavaScript engine. Dahl's specific goal was to fix a problem with how most web servers of the time handled slow operations like file reads β they'd block the entire process waiting. Node used an event-driven, non-blocking model instead, which let a single server handle thousands of simultaneous connections efficiently.
How itβs actually used today
Node.js runs the back end at Netflix (it cut their startup time dramatically when they migrated from Java), LinkedIn's mobile back end, PayPal's checkout flow, and much of Uber's dispatch system. It's especially popular for real-time features β chat apps, live notifications, collaborative editing β because of its non-blocking design.
Strengths & trade-offs
Node excels at I/O-heavy workloads (handling many network requests) but is a poor fit for CPU-heavy work like video encoding or heavy number-crunching, since JavaScript runs on a single thread by default. Its huge npm package ecosystem is both a major strength and a known source of dependency bloat if you're not careful.
What to learn next
Express or a similar framework is usually the next step for building actual APIs, and a database layer β PostgreSQL or MongoDB are both common pairings β comes right after, since almost no real Node.js backend exists without one.