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.
- About
- Prerequisites
- Repository structure
- How to run a project
- Common workflows
- Adding a new practice project
- Contribution guidelines
- License
- Contact
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.
- Node.js (recommended LTS; e.g. v18 or v20)
- npm or pnpm or yarn (whichever you prefer)
- Git
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/
 
- /projects/http-server/
- /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.
- 
Clone the repo: git clone https://github.com/MuqhtadeerM/Nodejs-Practice-code.git cd Nodejs-Practice-code
- 
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}/`);
});- Create a new folder for each experiment or small project.
- Add a package.jsonif using npm packages:npm init -y npm install <packages>
- Add a short README.mdinside each project to explain purpose and how to run it.
- Keep code small and focused — one idea per project.
- Add a folder under projects/with a descriptive kebab-case name (e.g.projects/file-watcher).
- Add a README.mdthat describes the project and how to run it.
- Add a package.jsonif needed.
- 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
- Open a PR when you want to merge changes into main.
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.
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
Consider using:
- ESLint for linting
- Prettier for consistent formatting Add configuration files at the repo root or per-project as needed.
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.)
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?