agyanadda@gmail.com

Node.js Introduction

Node.js Basics 1 min read Updated Dec 3, 2026 Topic 1 of 30

Node.js is a JavaScript runtime that runs JavaScript outside the browser — on servers, your computer and the command line. It is built on Chrome's V8 engine.

What can you build?

  • Web servers and REST APIs
  • Real-time apps: chat, live notifications (WebSockets)
  • Command-line tools
  • Build tools (Vite, Webpack and npm itself run on Node)
  • Microservices and backend for React, Vue or mobile apps

Why is Node.js fast?

Node uses a single thread with a non-blocking, event-driven model. While it waits for a database or a file, it handles other requests instead of sitting idle. This makes it great for apps with many users doing I/O.

Node.js vs browser JavaScript

Browser Node.js
window, document, DOM No DOM
Limited file access Full file system access (fs)
Runs on the user's device Runs on the server

Same language, different environment. Know basic JavaScript (variables, functions, objects, arrays) before you start.

Example

Example — Your first Node.js program JavaScript
// hello.js
const name = 'AgyanAdda';
console.log(`Hello from Node.js, ${name}!`);
console.log('Node version:', process.version);

// Run in the terminal:
// node hello.js

Output: Hello from Node.js, AgyanAdda! and the Node version, e.g. Node version: v22.x.x.

Test Yourself With Exercises

Exercise 1 Multiple Choice

What is Node.js?

Exercise 2 True / False

Node.js has the document object for working with the DOM.

Exercise 3 Fill in the Blank

Node.js is built on Chrome's ___ JavaScript engine.

Frequently Asked Questions

No. The language is JavaScript. Node.js is the environment (runtime) that lets JavaScript run on servers and computers.