SitePoint
  • Blog
  • Forum
  • Library
  • Login
Join Premium
Node.js: Novice to Ninja
Close
    • Node.js: Novice to Ninja
    • Notice of Rights
    • Notice of Liability
    • Trademark Notice
    • About Craig Buckler
    • About SitePoint
  1. 1What is Node.js?
    • Why Learn Node.js?
    • Summary
    • Quiz
    • 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 Console App
    • Restarting Node.js Applications with Nodemon
    • 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
    • Why use Express?
    • Create a New Node.js Project
    • Switch to ES6 Modules
    • Install Express
    • Create the Express Entry Script
    • Processing HTTP GET Query Strings
    • 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
    • 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
    • Single-threaded Non-blocking I/O Event-looping What?
    • The Event Loop
    • Callback Conundrums
    • Promises
    • async / await
    • Exercises
    • Summary
    • Quiz
    • A Database-driven Web Application Example
    • MongoDB
    • MySQL
    • Sequelize ORM
    • How to Choose the Right Database
    • Exercises
    • Summary
    • Quiz
    • What Are WebSockets?
    • Example WebSocket Chat Application
    • WebSocket Walkthrough
    • Advanced WebSockets Considerations
    • Exercise
    • Summary
    • Quiz
    • Process
    • OS
    • Util
    • URL
    • File System
    • Events
    • Streams
    • Worker Threads
    • Child Processes
    • Clusters
    • Exercises
    • Summary
    • Quiz
    • Source Code
    • Quizzing Quick Start
    • Summary
    • 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
    • Database Library
    • Question Database Initialization
    • Starting a New Game
    • Joining a Game
    • Quiz Page
    • Summary
    • Initiating a WebSocket Connection
    • Game Logic
    • Exercises
    • Summary
    • 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
    • Pages vs Applications
    • Node.js Application Preparation
    • Dedicated Server Hosting
    • Static Site Hosting (Jamstack)
    • Serverless/Lambda Functions
    • Container Hosting
    • Summary
    • Is Node.js for You?
    • Is Deno Better?
    • Thank You for Reading!

Example Real-time Multiplayer Quiz: WebSocket Code

Unlock This Title

You do not have access to this section. Get the full version of this title with a SitePoint Premium Account.

Start Free TrialRead Free Preview

Already a Premium member? Sign In

Community Questions