Node Introduction

What is Node.js?

Node.js is an open source runtime that lets you run JavaScript on the server. It is built on Chrome's V8 engine and is designed for fast, event-driven applications.

Instead of waiting for one task to finish before starting the next, Node.js handles many operations asynchronously. That makes it a strong fit for APIs, real-time apps, and tools that spend a lot of time waiting on network or file operations.

Analogy: The Restaurant Kitchen

Think of a synchronous kitchen: a chef cooks one dish from start to finish before even looking at the next order. The whole kitchen waits.

Node.js is an asynchronous kitchen: the chef starts cooking a steak (a slow task), then immediately starts chopping vegetables for a salad (a fast task) while the steak is on the grill. The kitchen is always productive, which is why Node.js is so efficient.

Why Learn Node.js?

Common Use Cases

Simple Server Example

const http = require('http');

const server = http.createServer((req, res) => {
    res.writeHead(200, { 'Content-Type': 'text/plain' });
    res.end('Hello from Node.js');
});

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

This example shows the basic Node.js pattern: receive a request, prepare a response, and send it back.

What To Remember

What To Learn Next

Once you understand this introduction, the next step is learning how to install Node.js, run npm, and create a small Express app.