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

express-create-backend

v1.2.0

Published

CLI to scaffold production-ready Express backend

Readme

Here is a clean, well-structured, and modern README.md file tailored for your express-create-backend CLI/generator project (the one that scaffolds a production-ready Express + Socket.io + MongoDB + JWT backend). You can copy-paste this directly into your README.md file at the root of your generator project. Markdown# express-create-backend

Scaffold a clean, modern, production-ready Express.js backend in seconds
with authentication, custom errors, logging, MongoDB, Socket.io support, and good security defaults.

Recommended (global install or via npx)

Recommended (via npx)

npx express-create-backend@latest my-backend-app npx express-create-backend my-backend-app

Or if installed globally

express-create-backend my-backend-app

Or if running locally from your project folder

node . my-backend-app

or

node index.js my-backend-app ✨ Features

MVC + Service + Utils folder structure JWT Authentication (register / login / protected routes) Custom error classes (BadRequestError, NotFoundError, …) Winston logging + Morgan request logging Helmet, CORS, JSON parsing, secure defaults Socket.io included with basic broadcast example MongoDB + Mongoose connection .env + .env.example ready Nodemon for development ESLint-ready (you can extend config)

Generated Project Structure After running the command, you get: my-backend-app/ ├── config/ │ ├── database.js │ ├── env.js │ └── logger.js ├── controllers/ │ └── users.controller.js ├── routes/ │ └── users.routes.js ├── services/ │ └── users.service.js ├── models/ │ └── user.model.js ├── middlewares/ │ ├── auth.middleware.js │ ├── error.middleware.js │ └── logger.middleware.js ├── utils/ │ └── jwt.util.js ├── errors/ │ ├── BaseError.js │ ├── BadRequestError.js │ └── NotFoundError.js ├── .env ├── .env.example ├── .gitignore ├── package.json ├── server.js └── README.md 🚀 Quick Start Bash# 1. Generate new backend npx express-create-backend@latest my-backend-app

2. Enter the folder

cd my-backend-app

3. Review & customize .env (especially JWT_SECRET and MONGO_URI)

(MongoDB Atlas or local MongoDB recommended)

4. Install dependencies (already done by generator, but just in case)

npm install

5. Start development server

npm run dev

or production mode:

npm start → Open http://localhost:5000 You should see: JSON{ "message": "Backend Running 🚀" } 📋 Available Scripts Bashnpm start Production mode (node server.js) npm run dev Development mode with auto-reload (nodemon) 🔑 Default API Endpoints

MethodEndpointDescriptionAuth?POST/api/users/registerRegister + return JWT tokenNoPOST/api/users/loginLogin + return JWT tokenNoGET/api/users/meGet current authenticated userYes 🔌 Socket.io (ready to use) Basic message broadcasting is already included in server.js: JavaScriptsocket.on("message", (msg) => { io.emit("message", msg); // broadcast to everyone }); You can easily extend it (chat rooms, typing indicators, private messages, etc.). 🔐 Security Defaults

helmet() → secure HTTP headers Passwords hashed with bcryptjs JWT with 7-day expiry Custom error responses (400, 401, 404, 500) CORS open by default (restrict in production!)

🛠️ Next Steps / Recommendations

Change JWT_SECRET to a long random value Restrict cors() origin in production Add input validation (zod, joi, express-validator) Add rate limiting (express-rate-limit) Add refresh tokens Add proper logging file rotation in production Deploy → Railway, Render, Fly.io, Vercel + MongoDB Atlas

🛠️ Tech Stack

Express 4 Mongoose / MongoDB Socket.io jsonwebtoken + bcryptjs winston + morgan helmet · cors · dotenv

Happy coding! 🚀