Skip to content

zarishnasir123/Node-JS-Backend

Repository files navigation

Node.js Backend Learning

A comprehensive learning project covering core Node.js concepts and modules for backend development.

Project Structure

1. hello-world-node/

Introduction to Node.js basics

  • index.js - Basic Node.js setup and execution
  • sum.js - Simple function module example

2. node-module-system/

Understanding Node.js module system

  • first-module.js - Creating and exporting modules
  • index.js - Importing and using modules
  • wrapper-demo.js - Demonstration of module wrapper
  • wrapper-explorer.js - Exploring how Node.js wraps modules

3. node-package-manager/

Working with npm and packages

  • index.js - NPM package management examples
  • package.json - Project dependencies and scripts

4. path-module/

Working with file paths

  • index.js - Using Node.js path module for path operations

5. file-system/

File system operations

  • index.js - Reading and writing files
  • data/ - Example data files for file operations

6. http-module/

Building HTTP servers

  • server.js - Basic HTTP server implementation
  • routes.js - Routing logic for the server

7. callbacks/

Asynchronous programming with callbacks

  • index.js - Callback examples
  • callback-hell.js - Demonstrating callback hell problem
  • input.txt - Example input file
  • output.txt - Example output file

8. promises/

Working with Promises

  • index.js - Promise examples and handling

9. async-await/

Modern async/await syntax

  • index.js - Async/await pattern examples

10. event-emitter/

Event handling in Node.js

  • index.js - EventEmitter usage
  • custom-listener.js - Creating custom event listeners

Getting Started

  1. Clone or download this repository
  2. Navigate to any lesson folder
  3. Run the examples using Node.js:
    node filename.js

Learning Path

Follow the lessons in numerical order to build a solid foundation in Node.js:

  1. Start with hello-world-node for basics
  2. Learn the module system
  3. Explore npm and package management
  4. Master file path handling
  5. Practice file system operations
  6. Build HTTP servers
  7. Master asynchronous patterns (callbacks → promises → async/await)
  8. Learn event handling

Requirements

  • Node.js (v12 or higher recommended)
  • npm (comes with Node.js)

Running Examples

Each lesson can typically be run with:

cd "folder-name"
node index.js

Notes

  • Some files demonstrate problems (like callback-hell.js) to show why better patterns exist
  • Examples build progressively in complexity
  • Each module includes practical demonstrations

About

This repository contains a structured set of Node.js backend lessons designed to help beginners and intermediate developers understand the core concepts of Node.js. It covers the essentials from creating your first Node.js application to advanced asynchronous programming techniques. Each folder focuses on a specific topic: starting with hello-world

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors