Features
create-mexn-app provides a battery-included experience without being overly opinionated.
1. Robust Templates
Templates are maintained externally to keep the CLI lightweight. Each template provides:
- Express 4.x with robust middleware (
helmet,cors,morgan,rate-limiter). - Mongoose integrated cleanly.
- Security best practices (
xss-clean,express-mongo-sanitize). - Zod for schema validation.
- Standardized error handling mechanism.
2. Swagger Automation
If you select the Swagger option during setup, the CLI will:
- Inject
swagger-ui-expressintodependenciesandswagger-autogenintodevDependencies. - Generate a
swagger.tsorswagger.jsconfiguration file automatically targeting your primary routes. - Inject a
npm run swaggerscript into yourpackage.json.
3. Smart Git Initialization
The CLI completely clears the .git directory coming from the remote boilerplate and cleanly runs git init -b main. It also interacts safely with target directories—warning you and offering the choice to cleanly overwrite existing paths without destroying their existing git histories!
4. Lightning Fast
Powered by giget, it pulls template tarballs without requiring full git history downloads, meaning project setup is virtually instantaneous.