Node.js introduction
What Node.js is, why companies use it, installing it and running your first script.
Node.js runs JavaScript outside the browser, on servers and your computer. It's built on Chrome's V8 engine and is used for REST APIs, real-time apps (chat, notifications), command-line tools and build tools such as Vite and Webpack.
Node is non-blocking: while it waits for a file, database or network call, it keeps serving other requests instead of sitting idle. That makes one Node process good at handling many connections at once.
Setup
- Install the LTS version from nodejs.org (it includes
npm, the package manager). - Check it in a terminal:
node -vandnpm -v. - Write JavaScript in a
.jsfile and run it withnode file.js.
There's no window or document in Node — instead you get modules for files, networking, processes and more.
Example code
Run with Node.js 20+// app.js
const name = "InfoparkDaily";
const skills = ["JavaScript", "Node.js", "Express"];
console.log("Hello from " + name + "!");
console.log("Node version:", process.version);
console.log("Skills:", skills.join(", "));
Output
Hello from InfoparkDaily!
Node version: v20.18.0
Skills: JavaScript, Node.js, Express
Save the code in a file such as app.js and run node app.js. For Express lessons, run npm install express first. Names and data are fictional.
Key points
- Node.js runs JavaScript on the server.
- It is non-blocking and event-driven, good for I/O-heavy apps.
- npm comes with Node and installs packages.
- Run a file with node file.js.
Quick check
Why is Node.js good at handling many requests at once?
Node's event loop lets one process continue with other requests while file, database or network calls are in progress.
Practice task
Install Node.js LTS, create hello.js that prints your name and today's date (new Date().toDateString()), and run it.
Interview corner
What is Node.js?
A JavaScript runtime built on the V8 engine that runs JavaScript outside the browser. It's event-driven and non-blocking, which suits APIs and real-time apps.
Is Node.js single-threaded?
Your JavaScript runs on a single main thread with an event loop, but Node uses a background thread pool (libuv) for some work such as file system operations and crypto, and you can use worker threads for CPU-heavy tasks.
Further reading
Official documentation, linked for deeper study. These are outside sites; this lesson's text is our own.
Original lesson written by the InfoparkDaily team · © 2026 InfoparkDaily · Free to learn — no paid course or subscription.