Skip to content

Commit 32654bd

Browse files
committed
merge dev into main (beginner lessons)
2 parents 5153ef8 + 9b79946 commit 32654bd

106 files changed

Lines changed: 1337 additions & 40 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 67 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,83 @@
1-
# 📒 nodejs-deep-dive
1+
# 📚 nodejs-course
22

3-
> A growing collection of notes, examples, and exercises covering JavaScript
4-
> internals and Node.js. Maintained as part of a Node.js course I taught.
3+
> A full Node.js course — from JavaScript fundamentals to Node core, Express,
4+
> databases, and production practices. Built from the material I taught as an
5+
> IT lecturer.
56
6-
![license](https://img.shields.io/badge/license-MIT-green.svg) ![node](https://img.shields.io/badge/node-18+-339933.svg) ![status](https://img.shields.io/badge/status-active-brightgreen.svg)
7+
![license](https://img.shields.io/badge/license-MIT-green.svg) ![node](https://img.shields.io/badge/node-18+-339933.svg) ![lessons](https://img.shields.io/badge/lessons-36-blue.svg) ![topics](https://img.shields.io/badge/topics-78-orange.svg) ![status](https://img.shields.io/badge/status-active-brightgreen.svg)
78

8-
## Table of Contents
9+
---
910

10-
### JavaScript Fundamentals
11-
- [Hoisting & TDZ](./topics/hoisting/)
12-
- [Closures & Scope](./topics/closures-and-scope/)
13-
- [`this` binding & arrow functions](./topics/this-binding/)
14-
- [Prototypes & classes](./topics/prototypes/)
15-
- [Promises & async/await](./topics/async-promises/)
16-
- [The event loop](./topics/event-loop/)
17-
- [Currying & higher-order functions](./topics/currying/)
18-
- [Modules: CommonJS vs ESM](./topics/modules/)
11+
## How this course is organised
1912

20-
### Node.js Core
21-
- [Streams](./topics/streams/)
22-
- [File system (`fs`)](./topics/fs-module/)
23-
- [HTTP module](./topics/http-module/)
24-
- [Process & environment](./topics/process-env/)
25-
- [`child_process`](./topics/child-process/)
26-
- [Worker threads](./topics/worker-threads/)
27-
- [Cluster mode](./topics/cluster/)
13+
- **`lessons/`** — the structured curriculum for beginners. Start here and go
14+
in order. Each lesson covers one concept with notes, a runnable example, and
15+
an exercise.
16+
- **`topics/`** — deeper dives into specific areas (JS internals, Node modules,
17+
Express, databases, DevOps). Reference these once you're comfortable with the
18+
basics.
2819

29-
### Web framework: Express
30-
- [Routing & basics](./topics/express-basics/)
31-
- [Middleware](./topics/express-middleware/)
32-
- [Error handling](./topics/express-error-handling/)
33-
- [JWT authentication](./topics/jwt-auth/)
20+
## Curriculum (lessons/)
3421

35-
### Database
36-
- [MongoDB / Mongoose](./topics/mongoose/)
22+
### Part 1 — Getting started
23+
1. [Setting up Node.js](./lessons/01-setup-node/)
24+
2. [Your first program](./lessons/02-first-program/)
25+
3. [Running code & the REPL](./lessons/03-running-and-repl/)
26+
4. [Comments](./lessons/04-comments/)
27+
5. [Syntax: statements & semicolons](./lessons/05-syntax-and-semicolons/)
28+
6. [Naming conventions](./lessons/06-naming-conventions/)
3729

38-
### Testing
39-
- [Jest fundamentals](./topics/jest/)
30+
### Part 2 — Values & types
31+
7. [Variables: let, const, var](./lessons/07-variables/)
32+
8. [Data types](./lessons/08-data-types/)
33+
9. [Strings](./lessons/09-strings/)
34+
10. [Numbers](./lessons/10-numbers/)
35+
11. [Booleans & truthiness](./lessons/11-booleans/)
36+
12. [null vs undefined](./lessons/12-null-undefined/)
37+
13. [Type conversion](./lessons/13-type-conversion/)
4038

41-
### Best practices
42-
- [Production checklist](./topics/best-practices/)
39+
### Part 3 — Operators & control flow
40+
14. [Arithmetic operators](./lessons/14-arithmetic-operators/)
41+
15. [Comparison operators](./lessons/15-comparison-operators/)
42+
16. [Logical operators](./lessons/16-logical-operators/)
43+
17. [if / else](./lessons/17-if-else/)
44+
18. [switch](./lessons/18-switch/)
45+
19. [Ternary operator](./lessons/19-ternary/)
46+
20. [while & do-while](./lessons/20-while-loops/)
47+
21. [for loops](./lessons/21-for-loops/)
4348

44-
---
49+
### Part 4 — Functions & scope
50+
22. [Functions](./lessons/22-functions/)
51+
23. [Function expressions vs declarations](./lessons/23-function-expressions/)
52+
24. [Arrow functions](./lessons/24-arrow-functions/)
53+
25. [Function parameters](./lessons/25-function-parameters/)
54+
26. [Scope](./lessons/26-scope/)
55+
56+
### Part 5 — Data structures
57+
27. [Arrays](./lessons/27-arrays/)
58+
28. [Iterating arrays](./lessons/28-array-iteration/)
59+
29. [Objects](./lessons/29-objects/)
60+
61+
### Part 6 — Async & Node basics
62+
30. [Callbacks](./lessons/30-callbacks/)
63+
31. [Input & output](./lessons/31-input-output/)
64+
32. [Modules: require & exports](./lessons/32-modules-require/)
65+
33. [Command-line arguments](./lessons/33-cli-args/)
66+
34. [Environment variables](./lessons/34-env-vars/)
67+
35. [Error handling basics](./lessons/35-error-handling-basics/)
68+
69+
## Deep-dive topics (topics/)
4570

46-
## How to use
71+
JavaScript internals (hoisting, closures, prototypes, the event loop…), Node
72+
core modules (streams, fs, crypto, worker threads…), Express (middleware, auth,
73+
validation…), databases (Postgres, Mongo, Redis…), and production concerns
74+
(Docker, CI, profiling, security). See the [`topics/`](./topics/) directory.
4775

48-
Each topic has its own folder containing:
49-
- A `README.md` with the lecture notes
50-
- `examples/*.js` with runnable code samples
51-
- `exercise.js` with a small practice task
76+
## Running examples
5277

53-
Browse by topic, or follow the order above for a structured walkthrough.
78+
```bash
79+
node lessons/01-setup-node/examples/check-version.js
80+
```
5481

5582
## License
5683

lessons/01-setup-node/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Lesson 01: Setting up Node.js
2+
3+
Install Node, manage versions, and run your first file.
4+
5+
## What you'll learn
6+
7+
- download the LTS version from nodejs.org, or use a version manager (nvm)
8+
- `node -v` and `npm -v` confirm the install
9+
- `nvm install 20 && nvm use 20` to switch versions
10+
- run a file: `node app.js`
11+
12+
## Example
13+
14+
See `examples/`.
15+
16+
## Exercise
17+
18+
Install Node 20 with nvm and print your version.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// run with: node check-version.js
2+
console.log('Node version:', process.version);
3+
console.log('Platform:', process.platform);
4+
console.log('You are ready to go!');

lessons/01-setup-node/exercise.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Lesson 01 exercise: Install Node 20 with nvm and print your version.
2+
// TODO: your solution here
3+
module.exports = {};

lessons/02-first-program/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Lesson 02: Your first program
2+
3+
Hello world, and how a JS file is executed.
4+
5+
## What you'll learn
6+
7+
- a `.js` file is a script run top-to-bottom
8+
- `console.log(...)` prints to the terminal
9+
- no compile step — Node runs the source directly
10+
- statements usually end with `;` (optional, see ASI lesson)
11+
12+
## Example
13+
14+
See `examples/`.
15+
16+
## Exercise
17+
18+
Print 'Hello, <your name>' using a variable.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// the classic first program
2+
console.log('Hello, world!');
3+
4+
// you can print multiple values
5+
console.log('1 + 1 =', 1 + 1);
6+
7+
// and use variables
8+
const name = 'Minh';
9+
console.log('Hi,', name);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Lesson 02 exercise: Print 'Hello, <your name>' using a variable.
2+
// TODO: your solution here
3+
module.exports = {};
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Lesson 03: Running code & the REPL
2+
3+
Two ways to run JS: a file, or the interactive REPL.
4+
5+
## What you'll learn
6+
7+
- `node file.js` runs a script
8+
- `node` with no args opens the REPL (Read-Eval-Print-Loop)
9+
- in the REPL, `_` holds the last result
10+
- `.exit` or Ctrl-D leaves the REPL
11+
12+
## Example
13+
14+
See `examples/`.
15+
16+
## Exercise
17+
18+
Open the REPL and compute the area of a circle radius 3.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
$ node
2+
> 1 + 1
3+
2
4+
> _ * 10
5+
20
6+
> const x = 5
7+
undefined
8+
> x ** 2
9+
25
10+
> .exit
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Lesson 03 exercise: Open the REPL and compute the area of a circle radius 3.
2+
// TODO: your solution here
3+
module.exports = {};

0 commit comments

Comments
 (0)