abhi-express-app-cli
v1.0.1
Published
CLI tool to generate Express.js applications
Downloads
65
Readme
Create Express App CLI Tool
Description
The Create Express App CLI tool is designed to help developers quickly generate an Express.js application boilerplate. This tool supports generating boilerplate code in both JavaScript and TypeScript, making it a convenient option for building server-side applications with Express.js.
Features
Generate a complete Express.js application boilerplate.
Choose between JavaScript or TypeScript templates.
Quickly set up your project structure for faster development.
Installation
You can install the package globally or use it directly with npx.
Using npx (no installation required)
npx create-express-app
Install Globally
npm install -g create-express-app
Then run the command:
create-express-app
Usage
- Run the CLI tool:
npx create-express-app
or (if installed globally):
create-express-app
Follow the prompts to:
Choose the language (JavaScript or TypeScript).
Specify the project name.
The CLI will generate the project structure and files in the specified folder.
Project Structure
Below is an example of the generated structure for both JavaScript and TypeScript projects:
JavaScript Example
my-express-app/
├── package.json
├── app.js
├── routes/
│ └── index.js
├── public/
├── views/
└── README.md
Description
package.json
: Contains the project metadata and dependencies.app.js
: Entry point of the application.routes
: Contains route handlers for the app.index.js
: Main route file.public/
: Static files like images, stylesheets, and scripts.views/
: Template files for the application.README.md
: Documentation for the project.
TypeScript Example
my-express-app/
├── package.json
├── tsconfig.json
├── src/
│ ├── app.ts
│ ├── routes/
│ │ └── index.ts
│ └── views/
└── README.md
Requirements
Node.js: Ensure you have Node.js installed (version 14 or later is recommended).
Dependencies
This package uses the following dependencies:
fs-extra
: To handle file and directory operations.
inquirer
: For interactive command-line prompts.
Contributing
Contributions are welcome! Feel free to submit issues or pull requests on the GitHub repository.
License
This project is licensed under the ISC License.
Happy coding!