express-generator1
v1.0.0
Published
The modern Express application generator. Scaffold a production-ready Express.js app in seconds with TypeScript, your choice of database (MongoDB, PostgreSQL, MySQL, SQLite), JWT auth, Docker, ESLint, Prettier, and more.
Readme
express-generator1
Scaffold a production-ready Express.js app in seconds — with TypeScript, your choice of database, JWT auth, and Docker baked in.
Quick start
npx express-generator1 my-appAn interactive wizard will ask a few questions, scaffold the project, and tell you what to run next.
Prefer flags? Skip the wizard:
npx express-generator1 my-app --ts --db=postgres --auth --docker --yesOr install globally and run anywhere:
npm install -g express-generator1
express-gen my-appWhat you get
- Modern Express 4.19 app with sensible defaults — JSON body parsing, cookies, logging, error handling,
dotenv - TypeScript or JavaScript — fully typed templates, strict mode, source maps
- Database integration — pick one:
- MongoDB (Mongoose)
- PostgreSQL (Prisma)
- MySQL (Sequelize)
- SQLite (better-sqlite3)
- JWT auth (optional) —
register/login/meendpoints, bcrypt-hashed passwords, auth middleware - Docker (optional) — multi-stage
Dockerfile+docker-compose.ymlwith your DB as a service - Linting (optional) — ESLint v9 flat config + Prettier + Husky pre-commit hook
- View engines (optional) — Pug, EJS, or Handlebars
CLI flags
| Flag | Values | Description |
|------|--------|-------------|
| --ts / --js | — | TypeScript (default) or JavaScript |
| -d, --db <type> | mongo · postgres · mysql · sqlite · none | Database |
| --auth | — | JWT auth scaffold |
| --docker | — | Dockerfile + docker-compose |
| --lint | — | ESLint + Prettier + Husky |
| -v, --view <engine> | pug · ejs · hbs · none | View engine |
| -c, --css <engine> | plain · less · sass · stylus | CSS engine |
| --git | — | git init |
| -y, --yes | — | Skip prompts (use flags + defaults) |
| -f, --force | — | Allow non-empty target directory |
After scaffolding
cd my-app
npm install
npm run dev # starts on http://localhost:3000If you chose Prisma:
npx prisma migrate dev --name initIf you chose Docker:
docker compose up -dJWT auth endpoints
When you use --auth, your app gets:
POST /auth/register { email, password } → { token, user }
POST /auth/login { email, password } → { token, user }
GET /auth/me Bearer <token> → { user }Passwords are hashed with bcryptjs. The User model auto-wires to your chosen database (or an in-memory store if you pick --db=none).
Why this generator?
| | express-generator1 | express-generator |
|---|---|---|
| Interactive wizard | ✅ | ❌ |
| TypeScript | ✅ | ❌ |
| Database integration | ✅ 4 options | ❌ |
| JWT auth | ✅ | ❌ |
| Docker | ✅ | ❌ |
| ESLint v9 / Prettier / Husky | ✅ | ❌ |
| Node engine | ≥ 18 | ≥ 0.10 |
| Generated style | const/let, async | var, callbacks |
License
MIT. Originally derived from express-generator by TJ Holowaychuk and contributors; modernized and extended.
