What Is Node.js?

Node.js is a JavaScript runtime built on the V8 JavaScript engine. It allows JavaScript to execute outside the browser, making it possible to build servers, APIs, command-line tools, background workers, automation scripts, and real-time applications.

Unlike browser JavaScript, Node.js provides APIs for operating-system and server-side capabilities such as the file system, networking, processes, environment variables, streams, and TCP sockets.

Node.js is especially effective for I/O-heavy workloads because applications can initiate asynchronous operations without blocking the JavaScript execution thread.

Runtime vs Language

JavaScript is the language. Node.js is a runtime that provides an environment and APIs for executing JavaScript outside the browser.

Node.js Runtime Overview
Your First Node.js Program
console.log('Hello from Node.js');
💡 Save the file as app.js and execute it with node app.js. Node.js runs the JavaScript without requiring a browser.
Key Takeaways
  • Node.js is a JavaScript runtime, not a new programming language.
  • Node.js is powered by V8 and provides server-side APIs through the Node.js runtime.
  • Its asynchronous architecture makes it well suited to I/O-heavy applications.
Knowledge Check

What is Node.js?