Node.js is JavaScript running outside the browser โ on servers, your laptop, anywhere. Same language you use for frontend, now building APIs, CLIs and backends.
Your first server โ 6 lines
const http = require("http");
http.createServer((req, res) => {
res.writeHead(200, { "Content-Type": "text/plain" });
res.end("Hello from Node!");
}).listen(3000);Run node server.js, open localhost:3000 โ you wrote a web server.
Why companies chose Node
- One language across the whole stack โ smaller teams, shared code
- Non-blocking I/O: one thread juggles thousands of connections while waiting on databases โ ideal for APIs and chat
- npm: the world's largest package registry โ a library for everything
What Node is NOT good at
Heavy CPU work (video encoding, ML training) blocks its single thread โ that is Python/Go/Rust territory, or Worker Threads.
Learning path
Node basics โ Express (the standard framework) โ REST APIs โ MongoDB/MySQL. Then test yourself with the 40 Node.js interview questions.