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-expressify

v1.0.3

Published

CLI tool to scaffold production-ready Express backends

Readme

create-expressify

A CLI tool to scaffold production-ready Express.js backends with TypeScript in seconds.

Installation

# Using npx (recommended)
npx create-expressify my-app

# Using pnpm
pnpm create expressify my-app

# Using yarn
yarn create expressify my-app

# Using bun
bun create expressify my-app

Features

Clean Code Patterns

  • Global Error Handler - Centralized error handling middleware
  • Custom Error Classes - 24+ pre-built error classes (BadRequest, NotFound, Unauthorized, etc.)
  • Response Wrapper - Consistent API response format
  • Async Handler - Automatic async/await error catching
  • Request Validator - Zod-based request validation middleware
  • Service Layer - Separation of business logic
  • Request ID Tracking - UUID-based request tracing
  • Graceful Shutdown - Clean server shutdown handling
  • API Versioning - /api/v1 route structure
  • Constants File - HTTP status codes and error messages
  • Type Definitions - TypeScript interfaces and types

Database Support

  • PostgreSQL
  • MySQL
  • SQLite
  • MongoDB
  • None (no database)

ORM Options

  • Prisma - Type-safe database client with migrations
  • Drizzle - Lightweight TypeScript ORM
  • None (raw queries)

Authentication

  • JWT - JSON Web Token authentication
  • Session - Session-based authentication with Redis
  • None (no auth)

Add-ons

  • Rate Limiting - Express rate limiter middleware
  • Redis Caching - Singleton-based Redis client with helper methods
  • GitHub Actions - CI/CD workflow configuration

Generated Project Structure

my-app/
├── src/
│   ├── config/
│   │   ├── env.ts          # Environment validation (Zod)
│   │   └── constants.ts    # HTTP status codes, error messages
│   ├── db/
│   │   └── index.ts        # Database client
│   ├── errors/
│   │   └── index.ts        # All error classes
│   ├── middleware/
│   │   ├── auth.ts         # Authentication middleware
│   │   ├── errorHandler.ts # Global error handler
│   │   ├── asyncHandler.ts # Async wrapper
│   │   ├── validate.ts     # Request validation
│   │   ├── requestId.ts    # Request ID tracking
│   │   └── rateLimiter.ts  # Rate limiting
│   ├── routes/
│   │   └── v1/
│   │       ├── index.ts    # Route aggregator
│   │       ├── health.ts   # Health check endpoint
│   │       └── auth.ts     # Auth routes
│   ├── services/
│   │   └── auth.service.ts # Auth business logic
│   ├── utils/
│   │   ├── logger.ts       # Pino logger
│   │   ├── response.ts     # Response helpers
│   │   └── redis.ts        # Redis singleton client
│   ├── app.ts              # Express app setup
│   └── index.ts            # Server entry point
├── prisma/
│   └── schema.prisma       # Prisma schema (if selected)
├── .github/
│   └── workflows/
│       └── ci.yml          # GitHub Actions CI
├── .env
├── .gitignore
├── .prettierrc
├── Dockerfile
├── docker-compose.yml
├── eslint.config.js
├── package.json
├── tsconfig.json
└── README.md

Error Classes

The generated project includes comprehensive error classes:

| Error Class | Status Code | Use Case | |-------------|-------------|----------| | BadRequestError | 400 | Invalid request syntax | | ValidationError | 400 | Request validation failed | | UnauthorizedError | 401 | Missing/invalid authentication | | InvalidCredentialsError | 401 | Wrong email/password | | TokenExpiredError | 401 | JWT token expired | | InvalidTokenError | 401 | Malformed token | | ForbiddenError | 403 | Access denied | | InsufficientPermissionsError | 403 | Missing permissions | | NotFoundError | 404 | Resource not found | | UserNotFoundError | 404 | User doesn't exist | | ResourceNotFoundError | 404 | Generic resource not found | | MethodNotAllowedError | 405 | HTTP method not supported | | ConflictError | 409 | Resource conflict | | DuplicateError | 409 | Duplicate entry | | EmailAlreadyExistsError | 409 | Email taken | | GoneError | 410 | Resource no longer available | | PayloadTooLargeError | 413 | Request body too large | | UnsupportedMediaTypeError | 415 | Content type not supported | | UnprocessableEntityError | 422 | Semantic errors | | TooManyRequestsError | 429 | Rate limit exceeded | | InternalServerError | 500 | Unexpected server error | | DatabaseError | 500 | Database operation failed | | ExternalServiceError | 500 | Third-party service error | | NotImplementedError | 501 | Feature not implemented | | BadGatewayError | 502 | Upstream server error | | ServiceUnavailableError | 503 | Server temporarily down | | GatewayTimeoutError | 504 | Upstream timeout |

Redis Client

The generated Redis client is a singleton with built-in helper methods:

import { redis } from './utils/redis';

// Connect to Redis
await redis.connect();

// Cache operations
await redis.set('user:1', { name: 'John' }, 3600); // with TTL
const user = await redis.get<User>('user:1');
await redis.del('user:1');

// Check connection
const isHealthy = await redis.ping();

// Disconnect
await redis.disconnect();

Requirements

  • Node.js >= 18.0.0

License

MIT