SitePoint
Blog
Forum
Library
Login
Join Premium
Toggle sidebar
Node.js: Novice to Ninja
Toggle community discussions
Close
Content
Files
Bookmarks
Preface
Node.js: Novice to Ninja
Notice of Rights
Notice of Liability
Trademark Notice
About Craig Buckler
About SitePoint
1
What is Node.js?
Why Learn Node.js?
Summary
Quiz
Install Node.js
Choosing a Node.js Version
How to Install Node.js on Linux (or Windows WSL2)
How to Install Node.js on macOS
How to Install Node.js on Windows
How to Install Node.js on Other Devices
Run JavaScript Commands in the Node.js REPL
Summary
Quiz
Your First Node.js Application
Your First Console App
Restarting Node.js Applications with Nodemon
How to Debug Node.js Scripts
What is Debugging?
How to Avoid Bugs
Node.js Debugging Environment Variables
Node.js Debugging Command-line Options
Console Debugging
Node.js util.debuglog
Debugging with Logging Modules
Node.js V8 Inspector
Debugging Node.js Apps with Chrome
Other Node.js Debugging Tools
Exercise: Debugging webhello.js
Summary
Quiz
Getting Started with Express
Why use Express?
Create a New Node.js Project
Switch to ES6 Modules
Install Express
Create the Express Entry Script
Processing Form Data with Express
Processing HTTP GET Query Strings
How to Use the npm Node Package Manager
Global vs Local Packages
npm Help
npm Configuration
Project Initialization
Searching for Packages
Installing Packages
“No-install” Execution
Listing Packages
Finding Outdated Packages
Removing Packages
Using npm Scripts
Publishing Packages
Exercises
Summary
Quiz
Using ES2015 and CommonJS Modules
CommonJS
ES2015 Modules (ESM)
Comparison of CommonJS and ES2015 Modules
Importing CommonJS Modules in ES2015
Requiring ES2015 Modules in CommonJS
Using ES2015 Modules in Browsers
Summary
Quiz
Asynchronous Programming in Node.js
Single-threaded Non-blocking I/O Event-looping What?
The Event Loop
Callback Conundrums
Promises
async / await
Exercises
Summary
Quiz
Using Database Storage
A Database-driven Web Application Example
MongoDB
MySQL
Sequelize ORM
How to Choose the Right Database
Exercises
Summary
Quiz
Using WebSockets
What Are WebSockets?
Example WebSocket Chat Application
WebSocket Walkthrough
Advanced WebSockets Considerations
Exercise
Summary
Quiz
Useful Node.js APIs
Process
OS
Util
URL
File System
Events
Streams
Worker Threads
Child Processes
Clusters
Exercises
Summary
Quiz
Example Real-time Multiplayer Quiz: Overview
Source Code
Quizzing Quick Start
Summary
Example Real-time Multiplayer Quiz: Architecture
Why Develop Using Multiple Servers?
1. One PostgreSQL Database Server
2. Two Express HTTP Web Servers
3. Three WebSocket Servers
4. One Traefic Load Balancer
5. Adminer Database Client
Docker Development Environment
Docker Production Environment
Summary
Example Real-time Multiplayer Quiz: Express Code
Database Library
Question Database Initialization
Starting a New Game
Joining a Game
Quiz Page
Summary
Example Real-time Multiplayer Quiz: WebSocket Code
Initiating a WebSocket Connection
Game Logic
Exercises
Summary
Node.js Tools and Resources
Perfect Package Pursuit
Development Tools
Testing
Logging
Full-stack Frameworks
Server-side Frameworks
Web Publishing, Content Management Systems, and Blogging
Headless Content Management Systems
Static Site Generators
Database Drivers
Templating
Command Line
File System
Network
WebSockets
Images
Email
Security and Authentication
Summary
Node.js Application Deployment
Pages vs Applications
Node.js Application Preparation
Dedicated Server Hosting
Static Site Hosting (Jamstack)
Serverless/Lambda Functions
Container Hosting
Summary
Epilogue
Is Node.js for You?
Is Deno Better?
Thank You for Reading!
Open text modal
Community Questions
Close