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

create-mern-cli

v1.1.4

Published

A powerful CLI tool to effortlessly generate a MERN stack project (MongoDB, Express, React, Node.js) with Vite/Webpack, Tailwind/Bootstrap, and backend frameworks like Express.js. Ideal for developers looking to bootstrap full-stack JavaScript projects wi

Readme

Create MERN CLI 🚀

A powerful CLI tool to scaffold full-stack MERN (MongoDB, Express, React, Node.js) applications with robust error handling and automatic cleanup.

MERN Stack Node Version License

Features ✨

  • Interactive Setup: Guided CLI prompts for project configuration
  • Automatic Error Recovery: Comprehensive cleanup on setup failures
  • Modern Frontend: Choose between Vite or Webpack
  • Backend Options: Mongoose (MongoDB) or Sequelize (SQL) support
  • Testing Ready: Optional Jest/Mocha testing setup
  • Production-Ready: Includes essential middleware and security best practices

Installation 📦

npx create-mern-cli@latest

For global installation:

npm install -g create-mern-cli
create-mern-cli

What's New in v2.0 🆕

  • Automatic Cleanup: If setup fails, all created files are removed
  • Enhanced Error Handling: Detailed error messages with recovery suggestions
  • Optimized Dependencies: Faster installation with only essential packages
  • Windows Support: Improved compatibility for Windows systems

Usage 🛠️

Run the CLI and follow the interactive prompts:

npx create-mern-cli

You'll be asked to configure:

  1. Project name
  2. Frontend bundler (Vite/Webpack)
  3. CSS framework (Tailwind/Bootstrap/None)
  4. Backend ORM (Mongoose/Sequelize/None)
  5. Testing setup (Jest/Mocha)

Project Structure 📂

Your new project will include:

project-name/
├── client/            # React frontend
│   ├── public/        # Static assets
│   ├── src/           # Application code
│   └── package.json   # Frontend dependencies
│
└── server/           # Node.js server
    ├── controllers/   # Business logic
    ├── routes/        # API endpoints  
    ├── models/        # Database models
    ├── .env           # Environment variables
    ├── index.js       # Server entry point
    └── package.json   # Backend dependencies

Error Recovery System ⚠️

The CLI features robust error handling:

  • Automatic Rollback: If any step fails, all created files are deleted
  • Detailed Logging: Clear error messages with cleanup status
  • Safe Retry: Clean state allows restarting the setup

Example error scenario:

Error: Failed to install dependencies
🧹 Cleaning up created files and directories...
  - Deleted file: /projects/test-mern/backend/package.json
  - Deleted directory: /projects/test-mern/backend
⚠️ Setup failed. All created files have been removed.

Getting Started 🏁

  1. Start development servers:
cd your-project-name
cd client && npm run dev  # Frontend
cd server && npm run dev # Backend
  1. Access your app at http://localhost:3000

Configuration ⚙️

Essential Environment Variables

Backend .env template:

PORT=5000
NODE_ENV=development

# MongoDB (if using Mongoose)
MONGO_URI=mongodb://localhost:27017/yourdb

# SQL (if using Sequelize)
DB_NAME=yourdb
DB_USER=root
DB_PASSWORD=
DB_HOST=localhost

Customizing the Backend

The generated backend includes:

  • Express server with CORS and JSON middleware
  • Example CRUD routes/controllers
  • Error handling middleware
  • Nodemon for development

Deployment 🚀

Frontend

cd client
npm run build  # Outputs to /dist

Backend

cd server
npm start     # Production mode

Recommended hosting:

  • Frontend: Vercel, Netlify, AWS S3
  • Backend: Railway, Heroku, AWS EC2

FAQ ❓

Q: What if installation gets interrupted?
A: The cleanup system will remove all partial files automatically.

Q: How do I add more backend routes?
A: Create new files in:

  • backend/routes/ for endpoints
  • backend/controllers/ for business logic

Q: Can I use TypeScript?
A: Yes! Select TypeScript when prompted during Vite setup.

Support 🛟

For issues, please:

  1. Check error messages carefully
  2. Clear node_modules and try again
  3. Open a GitHub issue with:
    • Node.js version (node -v)
    • Exact error message
    • Steps to reproduce

Contributing 🤝

We welcome contributions! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Submit a pull request

License 📄

MIT © Prashant Sharma and Vikas Tiwari

Thank You