CodeMasteryLab
Section 1

Node.js Fundamentals

Introduction to Node.js and its core concepts

Node.js Fundamentals

Node.js is a JavaScript runtime built on Chrome's V8 engine.

What is Node.js?

Node.js allows you to run JavaScript on the server side. It's:

  • Event-driven: Uses an event loop for handling concurrent operations
  • Non-blocking: Asynchronous I/O operations
  • Fast: Built on V8 JavaScript engine

Your First Node.js App

// app.js
console.log('Hello, Node.js!');

Run it:

node app.js

The Event Loop

Node.js uses a single-threaded event loop to handle concurrent operations efficiently.