Skip to content

MuqhtadeerM/Nodejs-Practice-code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Nodejs-Practice-code

A collection of small Node.js projects and practice exercises maintained by MuqhtadeerM. This repository is intended as a personal playground to try out Node.js features, patterns, and libraries — from tiny scripts to small services and experiments.

Table of contents

  • About
  • Prerequisites
  • Repository structure
  • How to run a project
  • Common workflows
  • Adding a new practice project
  • Contribution guidelines
  • License
  • Contact

About

This repo stores practice code for learning and experimenting with Node.js. Each exercise or small project should be isolated so it can be run and tested independently.

Prerequisites

  • Node.js (recommended LTS; e.g. v18 or v20)
  • npm or pnpm or yarn (whichever you prefer)
  • Git

Repository structure (suggested)

This repo may contain multiple small projects. A suggested layout:

  • /projects/ or /examples/ — main folder containing individual projects
    • /projects/http-server/
      • package.json
      • index.js
      • README.md (for project-specific notes)
    • /projects/crud-api/
    • /projects/cli-tools/
  • /scripts/ — small utility scripts used across projects
  • /.github/ — CI workflows (optional)
  • README.md — this file

Note: If your repo currently has a different layout, update the README to match.

How to run a project

  1. Clone the repo:

    git clone https://github.com/MuqhtadeerM/Nodejs-Practice-code.git
    cd Nodejs-Practice-code
    
  2. Find the project you want to run (for example projects/http-server) and follow that project's README. Common steps:

    cd projects/http-server
    npm install
    npm start      # or `node index.js`
    

Example minimal HTTP server (you can place this in projects/http-server/index.js):

const http = require('http');

const PORT = process.env.PORT || 3000;

const server = http.createServer((req, res) => {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello from Nodejs-Practice-code!\n');
});

server.listen(PORT, () => {
  console.log(`Server running at http://localhost:${PORT}/`);
});

Common workflows

  • Create a new folder for each experiment or small project.
  • Add a package.json if using npm packages:
    npm init -y
    npm install <packages>
    
  • Add a short README.md inside each project to explain purpose and how to run it.
  • Keep code small and focused — one idea per project.

Adding a new practice project

  1. Add a folder under projects/ with a descriptive kebab-case name (e.g. projects/file-watcher).
  2. Add a README.md that describes the project and how to run it.
  3. Add a package.json if needed.
  4. Commit and push:
    git checkout -b feat/add-file-watcher
    git add projects/file-watcher
    git commit -m "Add file-watcher practice project"
    git push origin feat/add-file-watcher
    
  5. Open a PR when you want to merge changes into main.

Contribution guidelines

This repository is primarily for your personal practice. If you accept contributions:

  • Use clear commit messages.
  • Open an issue or PR describing the change.
  • Keep the scope of PRs small and focused.
  • Include tests or usage examples where helpful.

Testing

For small exercises you can use:

  • Node built-in assertions and simple test scripts
  • Jest, Mocha, or other test runners for more structured tests

Example:

cd projects/some-project
npm install --save-dev jest
npx jest

Formatting and linting

Consider using:

  • ESLint for linting
  • Prettier for consistent formatting Add configuration files at the repo root or per-project as needed.

License

If you want a permissive license, add a LICENSE file (for example MIT):

MIT License
Copyright (c) 2025 MuqhtadeerM
<...>

(Replace with the license text you prefer.)

Contact

GitHub: https://github.com/MuqhtadeerM


If you'd like, I can:

  • Commit this README.md to the repository for you, creating a branch and opening a PR, or
  • Tailor the README to exactly match the current project list in your repo (I can read the repo and produce a project-specific README). Which would you prefer?

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published