Skip to content

A alternative to express-generator supporting ES Module, TypeScript, Jest, Dockerfile, ESLint & Prettier and path alias.

License

Notifications You must be signed in to change notification settings

RulerChen/gen-express-cli

Repository files navigation

GEN-EXPRESS-CLI

logo
GitHub License NPM Version node-current GitHub last commit NPM Downloads GitHub Repo stars

📘 Introduction

Note

GEN-EXPRESS-CLI now supports express 5! You can use the latest version of express with this CLI tool.

gen-express-cli is a alternative to express-generator with more features and easy to use. It is a command line tool that helps you to generate a new express project with TypeScript, ESM, Docker, Prettier, ESLint, Jest, and Path Alias.

✨ Features

  • 📦 ES Module
  • 📦 TypeScript
  • 📦 Prettier & ESLint
  • 📦 Jest
  • 📦 Path Alias
  • 📦 Dockerfile

📂 Quick Start

npx gen-express-cli@latest <project-name>
cd <project-name>
npm run dev # for development
npm run start # for production
npm run build # for typescript build
npm run lint # for eslint
npm run format # for prettier
npm run test # for unit test

docker build -t <image-name> .

📖 Usage

Usage

npx gen-express-cli --help

Usage: gen-express-cli [project-name]

Options:
  -v, --version                     output the current version
  -t, --template <template-name>    choose express template (choices: "javascript", "typescript")
  -l, --linter                      choose linter (default: false)
  -u, --unit-test <unit-test-name>  choose unit test (choices: "jest", "none")
  -d, --docker                      use docker for containerization (default: false)
  -al, --alias                      use alias for import (default: false)
  -m  --manager <package-manager>   choose package manager (choices: "npm", "yarn")
  -h, --help                        display help for command

📂 Folder Structure

├─ src
│  ├─ index.ts
│  ├─ __tests__
│  │  └─ user.spec.ts
│  ├─ controllers
│  │  └─ user.ts
│  ├─ models
│  │  └─ user.ts
│  └─ routes
│     ├─ index.ts
│     └─ user.ts
├─ .dockerignore
├─ .env
├─ .env.development
├─ .eslintrc.json
├─ .gitignore
├─ .prettierrc.json
├─ Dockerfile
├─ jest.config.ts
├─ package-lock.json
├─ package.json
├─ process.env.d.ts
├─ README.md
└─ tsconfig.json

📦 Dependencies

Please see dependency.js for more details.

📚 License

This project is licensed under the terms of the MIT license.

🤝 Contributing

Contributions, issues and feature requests are welcome! Feel free to give your feedback and give me a star if you like this project.