Skip to content

Repository files navigation

Node.js Learning Playground

Hands-on, runnable examples for the core Node.js concepts. Each file is self-contained, heavily commented, and ends with a TRY THIS section so you learn by changing the code, not just reading it.

How to run

From inside this folder, use either the direct command or the npm script:

Concept Direct command npm script
1. Event loop node 01-event-loop.js npm run event-loop
2. async / await node 02-async-await.js npm run async
3. Modules (ESM) node 03-modules/main.js npm run modules
3b. Modules (CommonJS) node 03-modules/legacy.cjs
4. Filesystem node 04-filesystem.js npm run files
5. HTTP server (raw) node 05-mini-server.js npm run server
6. Express (framework) node 06-express-server.js npm run express
7. EventEmitter node 07-eventemitter.js npm run events
8. Streams node 08-streams.js npm run streams

The npm scripts live in package.json under "scripts" — that's the standard place projects define their commands. Run npm run with no args to list them all.

Suggested order

  1. Event loop — the foundation. Predict the output before running.
  2. async / await — the everyday tool, built on the event loop.
  3. Modules — how real projects split code across files.
  4. Filesystem — async/await applied to real I/O.
  5. HTTP server — everything together; a working web server.

What package.json is

The project's manifest: its name, version, the module system ("type": "module" = use modern import/export), runnable scripts, and (once you install any) its dependencies. npm install <pkg> adds a package to node_modules/ and records it here.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages