Session Objective
By the end of this session, students will:
Understand what Node.js is and why it is used.
Be familiar with how Node.js works and its event-driven, non-blocking I/O model.
Learn about the core modules in Node.js and how to use them.
Build a simple Node.js application using core modules.
- Introduction to Node.js
What is Node.js?
Definition: Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine.
Purpose: It allows JavaScript to run outside the browser, enabling server-side and backend development.
Why Use Node.js?
Non-blocking I/O: Handles multiple tasks simultaneously using an event loop.
Single Programming Language: Use JavaScript for both frontend and backend.
Rich Ecosystem: NPM (Node Package Manager) offers thousands of reusable packages.
High Performance: Built on V8 engine, optimized for speed.
Key Features of Node.js
Event-Driven Architecture: Handles asynchronous operations efficiently.
Scalability: Suitable for building scalable network applications.
Cross-Platform: Runs on Windows, macOS, and Linux.