npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

chaubey-mern

v1.1.0

Published

CLI package to generate complete MERN and web development assignment projects.

Readme

chaubey-mern

Comprehensive CLI package to scaffold complete MERN and web development assignment projects (Assignments 1–8) from verified source templates.

chaubey-mern enables students and instructors to instantly scaffold standalone, ready-to-run assignment projects with preserved folder structures, accurate configurations, credential safety, dynamic student metadata, atomic staging, and clear next-step instructions.


Supported Assignments (Curriculum 1–8)

The package provides turnkey project generators for all 8 curriculum assignments:

| Assignment ID | Title | Category | Tech Stack | Database | Metadata Supported | |---|---|---|---|---|---| | assignment-1 | Assignment 1: JavaScript Calculator | Core JavaScript & DOM | HTML5, CSS3, Vanilla JS | None | None | | assignment-2 | Assignment 2: To-Do List Application | Core JavaScript & DOM | HTML5, CSS3, Vanilla JS | None | Student Name, PRN, Date | | assignment-3 | Assignment 3: JavaScript Form Validation | Core JavaScript & DOM | HTML5, CSS3, Vanilla JS | None | Student Name, PRN, Date | | assignment-4 | Assignment 4: React Profile Card using Props | React & Components | React 19, Vite 8, CSS3 | None | Student Name, PRN, Date | | assignment-5 | Assignment 5: Controlled React Form | React & State Management | React 19, Vite 8, CSS3 | None | Student Name, PRN, Date | | assignment-6 | Assignment 6: React Counter App using useState | React & State Management | React 19, Vite 8, CSS3 | None | Student Name, PRN, Date | | assignment-7 | Assignment 7: REST API using Express.js | Backend & Express | Node.js, Express.js (v5) | None (In-memory) | None | | assignment-8 | Assignment 8: MongoDB Integration using Mongoose | Full Stack & MERN | Node.js, Express.js, Mongoose, MongoDB | MongoDB | None (requires .env) |


Prerequisites

  • Node.js: Version 18.0.0 or higher (tested on Node v24.14.0).
  • npm: Version 9.0.0 or higher.
  • A modern web browser (for Assignments 1–6).
  • MongoDB (local mongod daemon or free MongoDB Atlas account for Assignment 8).

Usage

Direct Execution via npx (Zero Installation)

# 1. List all 8 supported assignments
npx chaubey-mern assignments

# 2. Generate any assignment (e.g. Assignment 1)
npx chaubey-mern create assignment-1 my-calculator

# 3. Generate Assignment 2 with student attribution
npx chaubey-mern create assignment-2 my-todo --student-name "Jane Doe" --student-id "PRN-12345"

# 4. Generate Assignment 4 (React Profile Cards) non-interactively
npx chaubey-mern create assignment-4 my-profiles --no-input

# 5. Generate Assignment 7 (Express REST API)
npx chaubey-mern create assignment-7 my-express-api --no-input

# 6. Generate Assignment 8 (MongoDB + Mongoose)
npx chaubey-mern create assignment-8 my-mongo-app --no-input

# 7. Check version and help
npx chaubey-mern --version
npx chaubey-mern --help

CLI Command Reference

create <assignment-id> [destination]

Scaffolds the specified assignment template into the target destination directory.

  • Arguments:
    • <assignment-id>: One of assignment-1 through assignment-8.
    • [destination]: (Optional) Path to target directory. Defaults to ./<assignment-id>.
  • Options:
    • -f, --force: Overwrite destination if the directory already exists and contains files.
    • --no-input: Disable interactive prompts and run non-interactively (ideal for CI/CD and scripts).
    • --student-name <name>: Provide student name for assignment submission.
    • --student-id <id>: Provide student PRN or ID.
    • --submission-date <date>: Provide submission date (YYYY-MM-DD).

Examples:

# Interactive creation (prompts for optional student metadata when applicable)
npx chaubey-mern create assignment-2

# Scripted non-interactive creation
npx chaubey-mern create assignment-3 ./form-project --no-input --student-name "Aarav Sharma" --student-id "PRN-2026-99"

# Overwrite existing folder with --force
npx chaubey-mern create assignment-1 ./calc-project --force

assignments

Displays an inventory of all 8 assignments with titles, tech stacks, and descriptions.

npx chaubey-mern assignments

Running the Generated Assignments

Assignments 1–3: Static Browser Applications

  1. Navigate to the generated directory:
    cd assignment-1 # or assignment-2 / assignment-3
  2. Open the HTML entry point in your browser:
    • Assignment 1: Open intex.html
    • Assignment 2: Open index.html
    • Assignment 3: Open index.html
    • Alternatively, serve locally:
      npx serve .

Assignments 4–6: React + Vite Applications

  1. Navigate to the generated directory:
    cd assignment-4 # or assignment-5 / assignment-6
  2. Install dependencies:
    npm install
  3. Start the Vite development server:
    npm run dev
  4. Open the displayed local URL in your browser (typically http://localhost:5173).

Assignment 7: Express.js REST API

  1. Navigate to the generated directory:
    cd assignment-7
  2. Install dependencies:
    npm install
  3. Start the Express server:
    node server.js
  4. Access endpoints on http://localhost:5000/api/users:
    • GET /api/users: Fetch all users
    • POST /api/users: Add a user { "name": "...", "email": "..." }
    • PUT /api/users/:id: Update a user
    • DELETE /api/users/:id: Remove a user

Assignment 8: MongoDB Integration using Mongoose

  1. Navigate to the generated directory:
    cd assignment-8
  2. Install dependencies:
    npm install
  3. Configure environment variables:
    # Copy template
    cp .env.example .env
    Edit .env with your MongoDB connection string:
    # For local MongoDB:
    MONGODB_URI=mongodb://127.0.0.1:27017/productDB
    PORT=5000
    
    # Or for MongoDB Atlas:
    # MONGODB_URI=mongodb+srv://<username>:<password>@cluster0.example.mongodb.net/productDB?retryWrites=true&w=majority
  4. Start the server:
    node server.js
  5. Test Product CRUD API endpoints on http://localhost:5000/api/products:
    • POST /api/products: Create product { "name": "...", "price": 99, "category": "...", "stock": 10 }
    • GET /api/products: Retrieve all products
    • GET /api/products/:id: Get product by ID
    • PUT /api/products/:id: Update price or stock
    • DELETE /api/products/:id: Delete product

Security & Credential Protection

  • No Personal Credentials: Real .env files, MongoDB connection strings with passwords, and private certificates are strictly excluded from packaging and project generation.
  • Content Scanner: Active validation ensures no raw database passwords or private keys are ever embedded into staged templates.
  • Safe .env.example: Automatically generated with safe placeholders whenever an assignment requires database or environment configuration.
  • Destination Protection: Refuses root paths (C:\, /), system folders (C:\Windows, /bin, etc.), blocks path traversal (../../), and guards against accidental non-empty directory overwrites without --force.
  • Atomic Staging: Generation takes place in an isolated temporary staging directory (os.tmpdir()). If any failure occurs, the target directory remains untouched.

Dynamic Student Attribution

  • Privacy Preserved: The original template author attributions (e.g. Adarsh Kumar, Skand Chaubey, Ankit Kumar) are systematically replaced with the generating student's details, or omitted with a clean generic title if skipped.
  • HTML Injection Protected: All student metadata is escaped to prevent XSS or malformed markup.
  • Format Validation: Dates are validated against the standard YYYY-MM-DD calendar format.

Development & Testing

# Run complete test suite (35+ automated tests)
npm test

# Run tests in watch mode
npm run test:watch

# Package into tarball
npm pack

License

MIT © 2026 Chaubey