Free course

Node.js Course

Learn to run JavaScript outside the browser, organize modules and packages, work with files, handle asynchronous events, and build HTTP servers.

5 modules · 51 lessons · No signup

Prerequisites: JavaScript, Shell Commands and HTTP

~~~

Your progress

of lessons completed.

Course completed.

What you'll learn

Build a small Node.js command-line program and an HTTP server using modules, files, asynchronous code, and environment configuration.

Take this course offline

Subscribe to my newsletter to get every free book and course in PDF and EPUB format.

Get the downloads

Course contents

  1. The Node.js runtime

    Install Node, run scripts, use the REPL, and work with process.

    1. The Node.js Guide
    2. How to install Node.js
    3. Differences between Node and the Browser
    4. How to use the Node.js REPL
    5. Run a Node.js script
    6. Node, accept arguments from the command line
    7. Output to the command line using Node
    8. Accept input from the command line in Node
    9. Check your understanding: the Node.js runtime
  2. Modules and npm

    Organize code and manage project packages and versions.

    1. The Node Core Modules
    2. CommonJS modules
    3. Expose functionality from a Node file using exports
    4. ES modules in Node.js
    5. The package.json guide
    6. An introduction to the npm package manager
    7. npm dependencies and devDependencies
    8. Semantic Versioning using npm
    9. Lock dependency versions
    10. Check your understanding: modules and npm
  3. Files and paths

    Read, write, inspect, and locate files without blocking work.

    1. The Node fs module
    2. Reading files with Node
    3. How to use the Node.js fs module with async/await
    4. Writing files with Node
    5. Working with folders in Node
    6. Node File Paths
    7. Node file stats
    8. Choose a filesystem API style
    9. Build a notes command-line program
    10. Check your understanding: files and paths
  4. Asynchronous code and events

    The event loop, promises, emitters, streams, and failures.

    1. The Node.js Event Loop
    2. Understanding process.nextTick()
    3. Understanding setImmediate()
    4. Use promises and await with Node.js callbacks
    5. The Node Event emitter
    6. Error handling in Node.js
    7. Node.js Streams
    8. Do not block the event loop
    9. Handle asynchronous failures
    10. Check your understanding: asynchronous code and events
  5. Servers and environment

    Requests, responses, configuration, deployment, and shutdown.

    1. How to read environment variables from Node.js
    2. Load an environment file
    3. Build an HTTP Server
    4. Serve an HTML page using Node.js
    5. Get HTTP request body data using Node
    6. Make an HTTP POST request using Node
    7. Route requests by method and URL
    8. Node, the difference between development and production
    9. Where to host a Node.js app
    10. Shut a server down gracefully
    11. Build a small JSON server
    12. Check your understanding: servers and environment