← Back to Node.js Course | Chapter 1: Introduction | Lesson 1 of 7

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:

  1. What is Node.js

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

javascript
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
  1. Thinking Node.js is a new language
  2. Expecting browser APIs like document and window to exist
  3. 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:

Login to run this code

C/C++/Java/PHP execution requires a free account. Your code is saved — you'll land right back in the editor after logging in.