What is Node.js?
Node.js is a JavaScript runtime built on Chrome's V8 engine that lets you run JavaScript outside a browser — on a server, in a script, or as a command-line tool. It added things browsers don't need (file system access, networking) and removed things servers don't need (a DOM, a window object).
Your First Node.js Script
# hello.js
console.log("Hello from Node.js!");
# Run it
node hello.jsWhat Node.js Enables
| Use Case | Example |
|---|---|
| Web servers & APIs | Express, Fastify, NestJS |
| Command-line tools | npm itself, ESLint, Prettier |
| Build tools | Vite, Webpack, Next.js |
| Scripting & automation | Deployment scripts, data processing |
Same Language, Different Environment
Core JavaScript (variables, functions, promises, classes) works identically in Node.js and the browser. What differs is the surrounding environment — Node.js gives you modules like fs and http instead of document and window.
Why Node.js Matters for Full-Stack JavaScript
Node.js is what makes it possible to use JavaScript on both the frontend and backend of an application — sharing types, validation logic, and even entire libraries between the two, and letting a team specialize in one language across the whole stack.
Best Practice
If you already know JavaScript from the browser, most of your knowledge transfers directly to Node.js — focus your learning specifically on the new APIs (modules, fs, http) rather than the language itself.