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

men-backend

v0.3.0

Published

Scaffold a MongoDB + Express + Node backend with a standardized module-sliced structure (Atlas/Docker + Cloudinary/ImageKit options)

Downloads

48

Readme

men-backend

Scaffolds a backend-only MongoDB + Express + Node (MEN) API with a standardized, module-sliced structure — the same conventions used across my projects: ESM, Express 5, Mongoose, common/ cross-cutting layer, feature folders under modules/, Joi DTO validation, ApiError/ApiResponse envelopes, and a central error handler.

Generated projects run on both Node (>= 20) and Bun.

Usage

npx men-backend [dir]              # via npm
bunx men-backend [dir]             # via bun
pnpm dlx men-backend [dir]         # via pnpm

Previously published as create-men-backend (deprecated). Heads-up for pnpm users: pnpm create men-backend resolves to the old create-men-backend package — use pnpm dlx men-backend instead.

Runs interactively when options are omitted:

? Where should the backend be created?  ./backend
? How do you want to run MongoDB?       MongoDB Atlas / Docker (local)
? Which media / file-storage?           None / Cloudinary / ImageKit

Or fully non-interactive with flags (works in CI, scripts, non-TTY):

npx men-backend ./server --docker --cloudinary
bunx men-backend my-api --atlas --imagekit
pnpm dlx men-backend ./backend --atlas --media none

| Flag | Description | | --- | --- | | [dir] | Target directory (default: ./backend, prompted) | | --atlas | MongoDB Atlas — SRV connection string lives in .env | | --docker | Local MongoDB via docker-compose.yml (+ db:up / db:down scripts) | | --media <choice> | none | cloudinary | imagekit | | --cloudinary / --imagekit | shorthands for --media … | | -h, --help / -v, --version | help / version |

At least one of --atlas / --docker and a --media choice are required in non-interactive mode.

What gets generated

Always: server.js, src/app.js, src/common/ (config, dto, middleware, utils), src/modules/health/ (liveness probe), src/modules/post/ (full example module: model, dto, service, controller, routes), .env.example, .gitignore, jsconfig.json, README.md, package.json.

Per choice:

| Choice | Adds | | --- | --- | | Atlas | MONGODB_URI=mongodb+srv://… placeholder in .env.example | | Docker | docker-compose.yml (mongo:8.0 + named volume), db:up/db:down scripts, MONGO_INITDB_ROOT_* + local MONGODB_URI in .env.example | | Cloudinary | src/common/config/cloudinary.js, cloudinary + multer deps, CLOUDINARY_* env keys | | ImageKit | src/common/config/imagekit.js, imagekit + multer deps, IMAGEKIT_* env keys |

The generated README.md documents the exact structure, env vars, response conventions, and how to add new modules.

Generated structure (example: Docker + ImageKit)

.
├── .env.example          # per-choice placeholders
├── .gitignore
├── README.md
├── docker-compose.yml    # local MongoDB
├── jsconfig.json
├── package.json
├── server.js             # dotenv → connectDB() → app.listen()
└── src/
    ├── app.js            # cors → parsers → routes → 404 → errorHandler
    ├── common/
    │   ├── config/       # db.js, imagekit.js
    │   ├── dto/          # base.dto.js
    │   ├── middleware/   # error-handler.js, validate.middleware.js
    │   └── utils/        # api-error.js, api-response.js
    └── modules/
        ├── health/       # GET /api/health
        └── post/         # example module — copy this pattern for new features
            ├── dto/      # create-post.dto.js, update-post.dto.js
            ├── post.controller.js
            ├── post.model.js
            ├── post.routes.js
            └── post.service.js

Development (this package)

npm install
npm test                          # node --test suite (render + generate)
node bin.js /tmp/demo --docker --cloudinary   # test generation locally

Layout:

  • bin.js — CLI: arg parsing, interactive prompts (@clack/prompts), orchestration
  • lib/generate.js — copies templates + renders decision-aware files
  • lib/render.js — generators for package.json, .env.example, README.md
  • test/ — node --test suite covering render output and generated file trees
  • template/ — base files (ships .gitignore as _gitignore; npm strips dotfiles)
  • template-docker/ — docker-compose.yml (Docker choice only)
  • template-media/ — cloudinary.js / imagekit.js (media choice only)

To test the exact artifact npm would publish:

npm pack
npm install -g ./men-backend-<version>.tgz
men-backend /tmp/demo --docker --imagekit

License

MIT