What is node.js: understanding the npm or npx with ports

Home / News
What is node.js: understanding the npm or npx with ports

Node.js is an open-source, cross-platform runtime environment that allows JavaScript to run outside the browser. Its event-driven, non-blocking architecture enables fast and efficient data handling, making it ideal for building scalable, real-time applications.
In this guide, you’ll learn the fundamentals of Node.js—how it works, where it’s used, and why it’s so popular. You’ll also see how to set it up on your system so you can start building applications right away.

What can Node.js do?

Node.js is a runtime that lets you run JavaScript outside the browser.

  • Normally: JavaScript runs in Chrome, Firefox, etc.
  • With Node.js: JavaScript runs on your computer / server.
  • In simple words: Node = JavaScript engine for backend & tools
  • Build backend APIs (Express, NestJS)
  • Handle files (read/write files)
  • Create CLI tools
  • Run build tools (Vite, Webpack, Next.js)
  • Example:
    console.log("Hello from Node");
  • Run it with:
    node app.js

Why do we use Node.js?

Main reasons

  • Same language everywhere
    (JS for frontend + backend)
  • Fast (non-blocking, event-driven)
  • Huge ecosystem (millions of packages)
  • Perfect for modern web tools

What is npm?

npm = Node Package Manager. It comes automatically with Node.js. 
What does npm do?

  • Install libraries
  • Manage dependencies
  • Run scripts
  • Example: npm install react

What is npx?

npm = Node Package Execute. It comes automatically with Node.js.
What does npx do?

  • Install libraries
  • Manage dependencies
  • Run scripts
  • Example: npm install react

Relation between Node, npm, and npx

Node.js → runs JavaScript
npm → installs packages
npx → runs packages

What is a port (really)?

A port is a numbered doorway into a computer.
  • IP address → which computer
  • Port → which program
  • 127.0.0.1:3000
  • 127.0.0.1 → this computer
  • 3000 → a specific app listening there

Common ports

Some Common posts:

  • Port – 80 – Service – HTTP
  • Port – 443 – Service – HTTPS
  • Port – 22 – Service – SSH
  • Port – 3000 – Service – Node / React (common
  • Port – 5173 – Service – Vite
  • Port – 3306 – Service – MySQL
  • Port – 8000 – Service – Dev servers
  • Port – 25 – Service – SMTP (email)servers
  • Port – 21 – Service – FTP

Node.js has transformed the way JavaScript is used by allowing it to run outside the browser. With its event-driven, non-blocking architecture, Node.js is well suited for building fast, scalable, and real-time applications. It enables developers to use a single language—JavaScript—for both frontend and backend development, improving productivity and consistency.

Leave a Comment