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

servergen

v2.5.0

Published

CLI that scaffolds production-ready Node.js, Express, and Hono apps with practical defaults, optional views, MongoDB, Postgres, Prisma, OpenAPI, and Docker support.

Readme

ServerGen

CI npm version npm downloads License: MIT Node >=20 GitHub release

ServerGen is an npm CLI for scaffolding Node.js, Express, and Hono API projects with practical defaults: MVC-style folders, health checks, Docker files, ready-to-run npm scripts, optional Express views, and optional Mongoose/MongoDB or Postgres/Prisma config.

30-Second Quick Start

Requires Node.js 20 or higher.

npm create servergen@latest
cd my-api
npm start

In another terminal:

curl http://localhost:3000/health

Expected response:

{"status":"ok"}

The create flow guides you through the app name and options interactively, creates an Express app by default, and runs npm install in the generated app unless install is skipped.

Prefer the direct CLI path when you already know the app name and options:

npx servergen@latest my-api

What Gets Generated

| Choice | Output | | --- | --- | | Default Express app | index.js, routes/index.js, controllers/, model/, views/, .env.example, Dockerfile, .dockerignore, .gitignore, generated README.md, package.json, and test/app.test.js. | | --typescript | TypeScript Express app with src/index.ts, src/routes/index.ts, tsconfig.json, test/app.test.ts, tsx for development, and dist/ output for production start. Hono apps are TypeScript by default. | | --framework node | Plain Node.js HTTP server with /, /about, /contact, and /health, plus MVC folders, Docker files, .gitignore, generated README.md, and package.json. | | --framework hono | TypeScript Hono API app with src/index.ts, tsconfig.json, test/app.test.ts, Docker files, .gitignore, generated README.md, and package.json. | | --view ejs, pug, or hbs | Adds the selected Express view template and renders it from /. | | --db mongodb | Adds Mongoose, config/mongoose.js, and MONGODB_URI in .env.example for Express apps. | | --typescript --db postgres --orm prisma | Adds Prisma 7, a Postgres Docker Compose service, prisma/schema.prisma, prisma.config.ts, src/lib/prisma.ts, /users routes/controllers, generated route tests, and DATABASE_URL in .env.example for Express TypeScript apps. | | --openapi | Adds docs/openapi.yaml, a static OpenAPI 3.0 spec for generated Express and Hono routes. Postgres/Prisma apps include /users paths. |

Generated apps include npm start and npm run dev. Express apps also include npm test. TypeScript Express and Hono apps also include npm run build.

CLI Usage

servergen [options] [name]

name is the app directory to create. You can also pass it with --name.

Options

  -V, --version           output the version number
  -n, --name <name>       name of the app to create
  -f, --framework <type>  framework: express | node | hono (default: "express")
  -v, --view <type>       view engine (express only): ejs | pug | hbs
  --db <type>             database: mongodb | postgres
  --orm <type>            ORM for supported databases: prisma
  --openapi               generate an OpenAPI spec file (express and hono)
  --typescript            generate a TypeScript app where supported
  -p, --port <number>     port for the generated app (1-65535) (default: "3000")
  --skip-install          skip the npm install step
  --debug                 enable debug logging
  -h, --help              display help for command

Examples

npm create servergen@latest
npx servergen@latest my-api
npx servergen@latest my-api --framework node
npx servergen@latest my-api --framework hono
npx servergen@latest my-api --view ejs
npx servergen@latest my-api --db mongodb
npx servergen@latest my-api --typescript --db postgres --orm prisma
npx servergen@latest my-api --openapi
npx servergen@latest my-api --typescript
npx servergen@latest my-api --port 8080
npx servergen@latest my-api --skip-install
npx servergen@latest --name my-api

For command-by-command walkthroughs, generated file lists, and verification steps, see the scaffold examples.

Install Options

Use the interactive create flow for the shortest first run:

npm create servergen@latest

Use npx when you want the direct CLI path without adding ServerGen to another project:

npx servergen@latest my-api

Install locally when you want ServerGen pinned in a project:

npm install --save-dev servergen
npx servergen my-api

For local installs, servergen is installed under node_modules/.bin and is not available as a plain shell command unless your shell PATH includes local npm bins.

Install globally when you want the servergen command available everywhere:

npm install -g servergen
servergen my-api

Release Integrity

Tagged releases are published from GitHub Actions with npm trusted publishing and provenance, using OIDC instead of a long-lived npm token. Before publishing, the release workflow packs the package, installs that tarball in a throwaway project, scaffolds Express, Hono, and Node apps, starts them, and verifies live HTTP responses.

The same workflow creates or updates the matching GitHub Release as latest after npm publish succeeds, so GitHub releases track the npm latest package.

License

MIT