The Wayback Machine - https://web.archive.org/web/20260308224929/https://www.geeksforgeeks.org/node-js/nodejs/

Node.js Tutorial

Last Updated : 7 Mar, 2026

Node.js is an open-source, cross-platform JavaScript runtime built on Chrome's V8 engine. It enables developers to run JavaScript outside the browser to build fast, scalable server-side applications.

  • JavaScript was initially frontend-only, and Node.js (2009) enabled backend development as well.
  • Non-blocking, event-driven architecture for high performance.
  • Supports the creation of REST APIs, real-time applications, and microservices.
  • Comes with a rich library of modules through npm (Node Package Manager).

Note: Deploy Node.js applications on Hostinger VPS for high performance using NVMe SSD storage and AMD EPYC processors. It offers scalable infrastructure, full root access, KVM virtualization, and a 300 Mb/s network for reliable connectivity.

First code example:

JavaScript
// Import the http module
const http = require("http");

// Create a server
const server = http.createServer((req, res) => {
    res.statusCode = 200;
    res.setHeader("Content-Type", "text/plain");
    res.end("Welcome to the Node.js Tutorial");
});

// Listen on port 3000
server.listen(3000, () => {
    console.log(
        "Server is running on http://localhost:3000");
});

It will start a server, and when you visit http://localhost:3000, it will display

Welcome to the Node.js Tutorial
  • The http module is imported to create a basic HTTP server.
  • The createServer() method is used to handle incoming requests and send responses.
  • The server listens on port 3000, and a message is displayed in the browser when accessed.

Need to Learn Node.js

It allows developers to build fast, scalable server-side applications using JavaScript.

  • Enables full-stack development with a single language.
  • Ideal for real-time apps like chat and gaming servers.
  • Handles I/O-intensive tasks efficiently with non-blocking architecture.
  • Supported by a large community and vast npm ecosystem.

Introduction to Node.js

Introduction to Node.js provides an overview of its runtime environment, architecture, and how it enables server-side JavaScript development.

Prerequisites:

Installation

To start with Node.js, you need to install and set it up on your machine.

Basics of Node.js

It cover the fundamental concepts such as its runtime environment, event-driven architecture, modules, and core features used to build scalable server-side applications.

Node.js Complete References

It cover the core modules and built-in APIs used for server-side development.

Node.js Interview Questions

Node.js Online Quiz Questions

Node.js Projects

Careers with Node.js

Around 6 million websites use Node.js, it is growing day by day. Most of the eCommerce, and IoT companies looking for pro Node.js developer.

Node.js Advantages

  • Easy Scalability: It compiles and executes JavaScript at lightning speeds, making it highly scalable.
  • Real-time Web Apps: It enables real-time communication for chat, gaming, social media updates, and more.
  • Microservices: It is lightweight and ideal for microservice architectures.
  • JavaScript Everywhere: It Learn JavaScript once, and you can use it both for front-end and back-end development.
  • Efficient Data Streaming: It efficiently handles I/O processes like media transcoding during uploads.
  • Event-Driven Architecture: Unlike traditional servers, Node.js handles concurrent requests effectively.
  • Strong Community Support: It has an independent community backing its development.
Comment

Explore