Node.js Introduction

Beginner
6 min read
Updated: Oct 2026
JavaScript runtime

What Is Node.js?

Node.js is an open-source JavaScript runtime that runs on servers and desktops—not in a browser. It uses Google’s V8 engine and an event-driven, non-blocking I/O model built for APIs, real-time apps, and tools.

Remember
JavaScript  =  the language
Node.js     =  the runtime outside the browser

Stack pieces:
  V8 engine  →  runs your JS
  libuv      →  async I/O & event loop
  npm        →  packages & scripts

Ryan Dahl created Node.js in 2009 so developers could use one language on both the client and the server. Today it powers backends, CLIs, build tools, and full-stack frameworks.

Why Use Node.js?

Browsers already run JavaScript. Node lets the same language handle files, networks, and processes on the server.

NeedHow Node.js helps
One language end-to-endShare JS skills between front end and back end
Fast I/O APIsNon-blocking model handles many connections well
Huge ecosystemnpm packages for almost any library or tool
Real-time featuresWebSockets, chat, and live dashboards

How Node.js Handles Work

Requests and I/O go through the event loop instead of blocking one thread per connection:

StepWhat happens
1. StartYou run node app.js; V8 loads your script
2. RegisterYour code sets up servers, timers, and callbacks
3. Event loopNode waits for I/O; when ready, it runs the callback
4. RespondYour handler sends a response or continues the work

Install, Hello World & First Server

Download the LTS build from nodejs.org, then verify:

terminal
node -v
npm -v
node hello.js
JavaScript
console.log('Hello World');

Hello World HTTP server

JavaScript
const http = require('http');

const server = http.createServer((request, response) => {
  response.writeHead(200, { 'Content-Type': 'text/plain' });
  response.end('Hello World\n');
});

server.listen(8080, () => {
  console.log('Server running at http://127.0.0.1:8080/');
});

How It Works

1. Module. require('http') loads Node’s built-in HTTP module.

2. Create. createServer registers a callback for each request.

3. Listen. listen(8080) starts the server; open the URL in a browser.

Next, build apps faster with Express.

Node.js vs Browser JavaScript

Same language, different environment and APIs:

Node.jsBrowser
Runs on servers & desktopsRuns in the user’s browser
Has fs, http, path, processHas DOM, window, document
Modules via require / importScripts and ES modules in pages
No built-in UIRenders HTML and CSS

When to use which

Use Node when…Use the browser when…
You build APIs, CLIs, or file toolsYou update the page or handle UI events
You need server secrets and databasesYou need DOM, canvas, or Web APIs
You run build tools (Vite, webpack, …)You ship front-end code to users

Core Building Blocks

These pieces show up in almost every Node project:

ConceptWhat it does
RuntimeExecutes JS with V8 outside the browser
Modulesrequire() (CommonJS) or import (ESM)
npmInstalls packages and runs project scripts
package.jsonProject metadata and dependencies
Built-insfs, path, http, url, os
Event loopSchedules async callbacks without blocking

Where Is Node.js Used?

Node shows up across modern JavaScript stacks:

Use caseWhy Node.js fits
REST / GraphQL APIsJSON in and out with Express, Fastify, Nest, …
Real-time appsChat, notifications, collaborative tools
Full-stack JSSame language for React/Vue front ends and the API
CLIs & toolingnpm scripts, bundlers, linters, generators
MicroservicesLightweight HTTP services that scale with I/O
ServerlessAWS Lambda, Azure Functions, and similar runtimes

Key Takeaways

  • Node.js runs JavaScript outside the browser with V8.
  • Start with node file.js, then try the http module.
  • npm installs packages; package.json tracks them.
  • Next step: frameworks like Express add routing and middleware.

One line: Node.js brings JavaScript to the server—next, learn Express.

Frequently Asked Questions

Node.js is an open-source JavaScript runtime that runs on servers and desktops—not in a browser. It uses Google's V8 engine and an event-driven, non-blocking I/O model, making it well suited for APIs, real-time apps, and CLI tools.
Yes. Node.js uses the same JavaScript language you write in the browser. Learn variables, functions, objects, and async basics first, then move to Node modules, npm, and building HTTP servers.
No. JavaScript is the programming language. Node.js is a runtime environment that executes JavaScript outside the browser and provides built-in modules for files, networking, and processes.
Download the LTS installer from nodejs.org for Windows, macOS, or Linux. Verify with node -v and npm -v in a terminal. Package managers like nvm are popular on macOS and Linux for switching versions.
npm (Node Package Manager) ships with Node.js. It installs open-source libraries from the npm registry, tracks dependencies in package.json, and runs scripts defined in your project.
Practice the built-in modules fs, path, and http. Then learn Express.js for routing and middleware, connect to MongoDB or PostgreSQL, and explore async patterns with Promises and async/await.

Did you know?

Node.js runs JavaScript outside the browser using the V8 engine. Install from nodejs.org, run scripts with node file.js, and manage packages with npm install.

Next: Express Introduction

Add routing and middleware on top of Node’s HTTP server.

Express intro →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

12 people found this page helpful