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-express-backend-kit

v1.0.3

Published

Scaffold a production-ready Express.js backend in seconds - folders, starter files, and all required libraries (helmet, cors, morgan, JWT auth, rate limiting, etc.) installed for you.

Readme

create-express-backend-kit

Scaffold a production-ready Express.js backend in one command: all folders, all starter files, and all required backend libraries installed for you.

npx create-express-backend-kit my-api

That's it - you get a running Express API with security, validation, rate limiting, JWT auth, tests, and linting already wired up.

What you get

Folders & files created:

my-api/
├── src/
│   ├── config/env.js               # centralized env loading & validation
│   ├── config/db.js                # MySQL connection (mysql2 createConnection)
│   ├── controllers/auth.controller.js
│   ├── middleware/                 # auth (JWT), validate, rateLimiter, errorHandler
│   ├── models/userStore.js         # in-memory store, easy DB swap
│   ├── routes/                     # index + auth routes
│   ├── utils/                      # logger, ApiError, asyncHandler, jwt, password
│   ├── app.js                      # express app
│   └── server.js                   # http server + graceful shutdown
├── tests/auth.test.js              # ready-to-run auth flow tests
├── .env / .env.example             # with a generated JWT secret
├── eslint.config.js / .prettierrc.json / nodemon.json / .gitignore
└── package.json + README.md

Libraries installed automatically:

| Category | Packages | | ----------------- | --------------------------------------------------------------- | | Core | express | | Database | mysql2 (createConnection, lazy connect, graceful close) | | Security | helmet, cors, express-rate-limit | | Auth | jsonwebtoken, bcryptjs | | Utilities | morgan, dotenv, express-validator, compression | | Dev | nodemon, eslint, prettier, cross-env |

Batteries included:

  • Health check at GET /health
  • Register / Login / Me endpoints with JWT auth
  • Request validation (express-validator) and central JSON error handler
  • Rate limiting (global + stricter on auth routes)
  • Security headers (helmet), CORS whitelist via env var, gzip compression
  • Structured JSON logging with levels
  • MySQL connection ready out of the box (src/config/db.js, query() helper)
  • Graceful shutdown (SIGINT/SIGTERM) that also closes the DB connection
  • Working tests (node:test) - no test framework config needed

Usage

# Interactive (asks project name / description / author)
npx create-express-backend-kit

# Non-interactive
npx create-express-backend-kit my-api --yes

# Options
npx create-express-backend-kit my-api --yes --git        # also init git repo
npx create-express-backend-kit my-api --yes --no-install # skip npm install

Then:

cd my-api
npm run dev

CLI options

| Flag | Description | | -------------- | -------------------------------------------- | | -y, --yes | Skip prompts, use defaults | | --no-install | Don't run npm install after scaffolding | | --git | Initialize a git repository in the project | | -h, --help | Show help | | -v, --version| Show version |

API endpoints included

| Method | Endpoint | Auth | Description | | ------ | -------------------- | ---- | --------------------- | | GET | /health | - | Health check | | POST | /api/auth/register | - | Register, returns JWT | | POST | /api/auth/login | - | Login, returns JWT | | GET | /api/auth/me | JWT | Current user profile |

Try it:

curl -X POST http://localhost:3000/api/auth/register \
  -H "Content-Type: application/json" \
  -d '{"name":"Ada","email":"[email protected]","password":"supersecret1"}'

Requirements

  • Node.js >= 16
  • npm

License

MIT