What is Node.js
Node.js lets you run JavaScript on your own computer or server instead of only inside a web browser.
In this page:
What is Node.js
Node.js is a JavaScript runtime built on Chrome's V8 engine. It runs JavaScript outside the browser, which makes it possible to build servers, command-line tools and scripts in one language.
It ships with a large standard library and the npm package manager.
Note:
Node.js is not a language or a framework; it is a runtime that executes JavaScript.
Example: What is Node.js
console.log("Hello from Node.js!");
console.log("Running on Node major version:", Number(process.versions.node.split(".")[0]) >= 18);
console.log("Has browser document object:", typeof document);
// Output:
// Hello from Node.js!
// Running on Node major version: true
// Has browser document object: undefined
⚠️ Run this in your own terminal or Node.js environment.
Related Topics
Common Mistakes
- Thinking Node.js is a new language
- Expecting browser APIs like document and window to exist
- Confusing Node.js with a web framework such as Express
Chapter Summary
- Node.js is a JavaScript runtime built on V8
- It runs JS outside the browser
- It includes built-in modules and npm
- Popular for servers, APIs and tooling
🔒
Chapter Quiz — Complete all 7 topics to unlock
0/7 topics done
Complete these topics first: