100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
Node.js

Introduction to Node.js

Learn what Node.js is, why it exists, and how it lets JavaScript run outside the browser on servers.

Introduction to Node.jsBeginner8 min readJul 8, 2026
Analogies

Introduction

Node.js is an open-source, cross-platform JavaScript runtime built on Google's V8 engine. It allows developers to run JavaScript code outside of a web browser, most commonly on a server. Before Node.js, JavaScript was almost exclusively a client-side scripting language used to add interactivity to web pages. Node.js changed that by giving JavaScript access to the file system, network, and operating system, enabling developers to build full backend applications, command-line tools, and APIs using a single language across the entire stack.

🏏

Cricket analogy: Before Node.js, JavaScript was like a player who could only bat in exhibition matches (browsers); Node.js let that same player join the full squad, bowling and fielding too, by giving JS access to the file system and network.

Node.js was created by Ryan Dahl in 2009. Its defining design choice was to be non-blocking and event-driven, which makes it especially well suited for I/O-heavy applications such as web servers, real-time chat applications, and streaming services.

🏏

Cricket analogy: Ryan Dahl designing Node.js as non-blocking is like a captain designing a fielding strategy around quick reflexes rather than waiting idly, which is why Node thrives in fast, I/O-heavy scenarios like live streaming.

How It Works

Node.js embeds the V8 JavaScript engine (also used in Google Chrome) to compile and execute JavaScript directly to machine code. On top of V8, Node.js adds a set of built-in APIs (modules like fs, http, path) written in C++ and JavaScript that expose operating system features. Node.js uses libuv, a C library, to handle asynchronous, non-blocking I/O operations and to provide the event loop, thread pool, and cross-platform abstractions for file system and network operations.

🏏

Cricket analogy: V8 is like the bat that translates a swing into runs; Node's built-in modules are like the coaching staff (fs, http, path) providing structure, while libuv is like the ground crew handling weather delays and pitch conditions behind the scenes.

javascript
// hello.js
console.log('Hello from Node.js!');
console.log('Node version:', process.version);

Explanation

The example above is a plain JavaScript file with no browser-only APIs like window or document. Instead, it uses process, a global object provided by Node.js that gives information about the currently running process, such as the Node.js version, command-line arguments, and environment variables. Running this file with the node command executes it directly using the V8 engine, without needing a browser.

🏏

Cricket analogy: A player using field-specific gear like spikes and pads (Node's process object) instead of casual sneakers (browser APis like window) is equipped for the actual playing surface, running the file directly rather than through a browser.

Example

bash
node hello.js

Output

bash
Hello from Node.js!
Node version: v20.11.1

Key Takeaways

  • Node.js is a JavaScript runtime built on Chrome's V8 engine, not a framework or language.
  • It lets JavaScript run outside the browser, enabling server-side and command-line applications.
  • Node.js uses an event-driven, non-blocking I/O model, making it efficient for I/O-heavy workloads.
  • libuv provides the event loop and handles asynchronous operations under the hood.
  • Common use cases include REST APIs, real-time apps, microservices, and build tooling.

Practice what you learned

Was this page helpful?

Topics covered

#NodeJs#NodeJsExpressStudyNotes#WebDevelopment#IntroductionToNodeJs#Node#Works#Explanation#Example#StudyNotes#SkillVeris