@franshiro/express-cli v0.1.7
@franshiro/express-cli
A powerful CLI tool for generating Express.js templates and managing modules with best practices and modern architecture.
Features
- š Quick project setup with Express.js
- š¦ Modern project structure
- š§ Built-in configuration templates
- š ļø Easy to use CLI interface
- š Interactive project generation
- š Module generation for existing projects
Installation
npm install -g @franshiro/express-cliUsage
After installation, run the CLI:
express-template-2You'll be presented with the following options:
- Create a new project
- Add new module to an existing project
- Cancel
Creating a New Project
When you choose "Create a new project", you'll be prompted to:
- Enter the project name (e.g., project-name)
The CLI will create a new Express.js project with the specified name.
Adding a New Module
When you choose "Add new module to an existing project", you'll be prompted to:
- Enter the module name (e.g., UserPayment)
After entering the module name, you'll have several options:
Create Custom File
- Choose whether to create a custom function file
- If yes, a custom function file will be created with example methods
Generate New Model
- Choose whether to generate a new model
- If yes, you'll be prompted to:
- Add columns in the format:
name:stringorprice:decimal(15,2) - Supported column types: string, integer, float, boolean, date, text, json, decimal
- Continue adding columns until you're done
- Add columns in the format:
- The CLI will automatically:
- Create a migration file
- Create a model file
- Add the model to the database models import
- Add API routes with CRUD operations and middleware
Just Create Files
- If you choose not to generate a model, the CLI will create:
- Service module file
- Controller module file
- Router module file
- If you choose not to generate a model, the CLI will create:
After module creation, you'll need to:
- Review and modify the generated migration and model files if needed
- Run migrations:
npm run db:migrate
Project Structure
The generated project will include:
project-name/
āāā src/
ā āāā _utils/
ā āāā customFunctions/
ā āāā database/
ā āāā helpers/
ā āāā middlewares/
ā āāā validations/
ā āāā .babelrc
ā āāā index.js
āāā .env.example
āāā .gitignore
āāā .sequelizerc
āāā package.json
āāā README.mdDependencies
- Node.js 14.x or higher
- npm 6.x or higher
Development
# Clone the repository
git clone https://github.com/yourusername/express-cli.git
# Install dependencies
npm install
# Run tests
npm testLicense
ISC Ā© franshiromedia
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago