DevAcademy
LearnNode.jsNode.js Introduction
BeginnerNode.js

Node.js Introduction

Understand what Node.js is, how it lets JavaScript run outside the browser, and where it is used.

Reading Time

10 min

Lesson

Lesson 1 of 34

What is Node.js?

Node.js is a JavaScript runtime built on Chrome's V8 engine that lets you run JavaScript outside a browser — on a server, in a script, or as a command-line tool. It added things browsers don't need (file system access, networking) and removed things servers don't need (a DOM, a window object).

Your First Node.js Script

# hello.js
console.log("Hello from Node.js!");

# Run it
node hello.js

What Node.js Enables

Use CaseExample
Web servers & APIsExpress, Fastify, NestJS
Command-line toolsnpm itself, ESLint, Prettier
Build toolsVite, Webpack, Next.js
Scripting & automationDeployment scripts, data processing

Same Language, Different Environment

Core JavaScript (variables, functions, promises, classes) works identically in Node.js and the browser. What differs is the surrounding environment — Node.js gives you modules like fs and http instead of document and window.

Why Node.js Matters for Full-Stack JavaScript

Node.js is what makes it possible to use JavaScript on both the frontend and backend of an application — sharing types, validation logic, and even entire libraries between the two, and letting a team specialize in one language across the whole stack.

Best Practice

If you already know JavaScript from the browser, most of your knowledge transfers directly to Node.js — focus your learning specifically on the new APIs (modules, fs, http) rather than the language itself.

Interview Questions

Quick Quiz

1. What engine is Node.js built on?

2. What is a key difference between Node.js and browser JavaScript?

3. Which of these is a common Node.js use case?

Next