1.1.3 • Published 5 months ago

fast-express-gen v1.1.3

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

Fast Express Gen

šŸš€ Fast Express Gen is a CLI tool designed to generate a complete Express.js boilerplate in seconds. It provides a robust starting point for backend development with pre-configured features like middleware, routing, and error handling. Now supports both JavaScript and TypeScript!


🌟 Features

  • Express.js Setup: Fully configured Express server with modular architecture.
  • Middlewares: Pre-installed and configured middlewares for security, logging, and compression.
  • Customization: Choose your project name and whether to use JavaScript or TypeScript.
  • Developer-Friendly: Includes nodemon for hot-reloading and a README.md template for your generated project.

šŸ“¦ Installation

You can use npx to run the CLI directly or install it globally.

Using npx

npx fast-express-gen

Global Installation

npm install -g fast-express-gen

šŸ› ļø Usage

Create a New Project

Run the following command to generate your project:

fast-express-gen <project-name>

Example:

fast-express-gen my-awesome-api

You will then be prompted to select JavaScript or TypeScript for your project.

This will create a new directory my-awesome-api with a ready-to-use Express.js boilerplate.


šŸ–‡ļø Project Structure

Below is the structure of the generated project:

JavaScript Version

<project-name>/
ā”œā”€ā”€ nodemon.json
ā”œā”€ā”€ package.json
ā”œā”€ā”€ README.md
└── src/
    ā”œā”€ā”€ app.js
    ā”œā”€ā”€ controllers/
    │   └── homeController.js
    ā”œā”€ā”€ middleware/
    │   └── logger.js
    ā”œā”€ā”€ routes/
    │   └── index.js
    └── server.js

TypeScript Version

<project-name>/
ā”œā”€ā”€ nodemon.json
ā”œā”€ā”€ package.json
ā”œā”€ā”€ tsconfig.json
ā”œā”€ā”€ README.md
└── src/
    ā”œā”€ā”€ app.ts
    ā”œā”€ā”€ controllers/
    │   └── homeController.ts
    ā”œā”€ā”€ middleware/
    │   └── logger.ts
    ā”œā”€ā”€ routes/
    │   └── index.ts
    └── server.ts

āš™ļø Features in Detail

  1. Security:

    • Integrated helmet for secure HTTP headers.
    • CORS (Cross-Origin Resource Sharing) enabled for flexible API usage.
  2. Error Handling:

    • Centralized error handling middleware.
  3. Logging:

    • Request logging with morgan.
  4. Hot Reload:

    • Pre-configured nodemon for live reloading during development.

✨ Example Output

Console

Welcome to fast-express-gen!
āœ” Project name: my-awesome-api
āœ” Choose your project language: TypeScript
Creating TypeScript project in /path/to/my-awesome-api...
Installing dependencies...
Your Express project is ready! šŸš€

Run the following commands to get started:

cd my-awesome-api
npm run dev

šŸ¤ Contributing

Contributions are welcome! If you'd like to improve this tool, feel free to fork the repository and open a pull request.

GitHub


šŸ“ License

This project is licensed under the MIT License.


šŸ’¬ Questions or Feedback?

If you have any questions, suggestions, or feedback, please reach out to the repository owner. Happy coding! 😊

1.1.3

5 months ago

1.1.1

6 months ago

1.1.0

6 months ago

1.0.7

6 months ago

1.0.6

6 months ago

1.0.5

6 months ago

1.0.4

6 months ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago