A comprehensive Node.js learning repository demonstrating fundamental to advanced concepts from Mosh Hamedani's "Node.js: The Complete Guide to Build RESTful APIs (2018)" course.
Built in November 2018. This repository contains 4 progressive learning modules covering Node.js basics, core modules, debugging, web scraping, and Express.js fundamentals.
- 📚 4 Progressive learning modules from basics to advanced
- 🧪 Testing examples with Jest
- 🔍 Debugging configurations for VSCode
- 🌐 Web scraping examples with Nightmare.js and Crawler
- 🗂️ File system operations and directory traversal
- 🚀 Express.js server setup examples
- 💡 JavaScript fundamentals (scope, closures, context)
- Node.js (v8 or higher recommended for course compatibility)
- npm (comes with Node.js)
- VSCode (recommended for debugging features)
- Clone the repository:
git clone https://github.com/orassayag/nodejs-learning-v2.git
cd nodejs-learning-v2- Navigate to a specific module and install dependencies:
cd 02/first-app
npm install- Run the module:
npm startPath: 01/first-app/
Basic Node.js execution with a simple greeting function.
cd 01/first-app
node app.jsLearning objectives:
- Running JavaScript with Node.js
- Function definitions
- Template literals
Path: 02/first-app/
Explores Node.js built-in modules including path, file system, and custom modules.
cd 02/first-app
npm install
npm startLearning objectives:
- Creating and importing custom modules
- Working with the
pathmodule - File system operations (
fs) - Directory traversal algorithms
- Unit testing with Jest
Path: 03/firstApp/
JavaScript basics focusing on scope and iteration.
cd 03/firstApp
node index.jsLearning objectives:
- Block scope with
let - Loop constructs
- Variable lifecycle
Path: 04/debug-demo/
Advanced examples including web scraping, debugging, and Express.js.
cd 04/debug-demo
npm install
node index.jsLearning objectives:
- Web scraping with Nightmare.js (headless browser)
- Crawling with the Crawler library
- Debugging with breakpoints
- Express.js server setup
- Arrow functions vs regular functions
- Context (
this) binding - Closures and IIFE patterns
- Recursive file system traversal
graph TD
A[nodejs-learning-v2] --> B[01/first-app]
A --> C[02/first-app]
A --> D[03/firstApp]
A --> E[04/debug-demo]
B --> B1[app.js - Hello World]
C --> C1[app.js - Core modules]
C --> C2[logger.js - Custom module]
C --> C3[package.json - Jest testing]
D --> D1[index.js - Scope examples]
E --> E1[index.js - Scraping & debugging]
E --> E2[Dependencies: nightmare, crawler, express]
flowchart LR
A[Start Learning] --> B[Module 01: Basics]
B --> C[Module 02: Core Modules]
C --> D[Module 03: JavaScript Fundamentals]
D --> E[Module 04: Advanced Topics]
E --> F[Complete]
style A fill:#e1f5ff
style F fill:#d4edda
Each module may have different scripts. Common ones:
npm start # Run the application
npm test # Run Jest testsnode app.js # or node index.jsModule 02 includes VSCode launch configurations:
- Open the module in VSCode
- Set breakpoints in code
- Press F5 to start debugging
node inspect index.js- jest (^22.2.2) - Testing framework
- express (^4.16.4) - Web application framework
- nightmare (^3.0.1) - Headless browser automation
- crawler (^1.2.0) - Web crawling and scraping
- after-load (^1.0.4) - HTML page loading utility
- Module system (
require,module.exports) - Built-in modules (
path,fs) - Asynchronous patterns
- Error handling
- Arrow functions vs regular functions
- Context (
this) binding - Closures and scope
- IIFE (Immediately Invoked Function Expressions)
- Block scope vs function scope
- Express.js basics
- Web scraping ethics and techniques
- HTTP requests
- DOM manipulation with headless browsers
- Unit testing with Jest
- Debugging techniques
- Code organization
- Module patterns
// logger.js
module.exports = function(message) {
console.log(message);
};
// app.js
const log = require('./logger');
log('Hello World');const Nightmare = require('nightmare');
const nightmare = Nightmare();
nightmare
.goto('https://example.com')
.evaluate(() => document.querySelector('h1').innerText)
.then(console.log);Contributions to this project are released to the public under the project's open source license.
Everyone is welcome to contribute. Contributing doesn't just mean submitting pull requests—there are many different ways to get involved, including answering questions and reporting issues.
Please feel free to contact me with any question, comment, pull-request, issue, or any other thing you have in mind.
- Or Assayag - Initial work - orassayag
- Or Assayag orassayag@gmail.com
- GitHub: https://github.com/orassayag
- StackOverflow: https://stackoverflow.com/users/4442606/or-assayag?tab=profile
- LinkedIn: https://linkedin.com/in/orassayag
This application has an MIT license - see the LICENSE file for details.
- Mosh Hamedani - Course instructor
- Course: "Node.js: The Complete Guide to Build RESTful APIs (2018)"
- Built as part of a structured learning journey in November 2018