Course contentsShow
← JavaScript
Lesson 18 of 2,7231. JavaScript FoundationsFree lesson

Node.js Runtime: Server-Side JavaScript

Node.js pairs V8 with APIs for file system, networking, and OS access, enabling JavaScript on servers.

Node.js Runtime: Server-Side JavaScript

What you'll learn: How Node.js extends JavaScript beyond the browser to run on servers and your local machine.

What is Node.js?

Remember how we learned that a runtime is a JavaScript engine plus extra APIs? The browser runtime pairs the V8 engine with DOM and Web APIs for building web pages. Node.js takes that same V8 engine and pairs it with completely different APIs designed for server-side tasks.

What Makes Node.js Different?

Instead of giving you document.getElementById() or window.alert(), Node.js provides APIs for:

  • File system access – reading and writing files on your computer
  • Networking – creating web servers, making HTTP requests
  • Operating system interaction – accessing environment variables, system info
  • Process management – running scripts, handling command-line input

Think of it like this: V8 is the engine, but the browser runtime and Node.js runtime are two different cars built around it. One car (browser) is designed for displaying web pages. The other car (Node.js) is built for server work, file manipulation, and backend tasks.

Why Does This Matter?

Before Node.js, JavaScript only ran in browsers. With Node.js, you can:

  • Build web servers that handle requests
  • Create command-line tools
  • Process files and data on your computer
  • Write backend code in the same language as your frontend

Both environments use JavaScript (variables, functions, loops), but they have different superpowers based on their purpose.

Key Takeaway: Node.js is a runtime that combines V8 with server-focused APIs (file system, networking, OS access), enabling JavaScript to run outside the browser for backend and system-level tasks.