express-basic-starter
Version:
CLI to set up a basic Express project with MVC structure, Swagger documentation, and support for ES Modules/CommonJS
66 lines (50 loc) ⢠1.97 kB
Markdown
# Express Basic Starter v2.0.0
[](https://badge.fury.io/js/express-basic-starter)
[](https://opensource.org/licenses/ISC)
A lightweight, professional-grade CLI tool for scaffolding Express.js applications with a well-structured layout, essential packages, and built-in Swagger documentation. Supports both ES Modules and CommonJS.
## Key Features
- š **Zero Configuration**: Get started with a single command
- š **MVC Architecture**: Pre-configured Model-View-Controller structure
- š **API Documentation**: Built-in Swagger/OpenAPI documentation
- š **Security**: JWT authentication utility included
- ⨠**Modern JavaScript**: Support for both ES Modules and CommonJS
- š ļø **Error Handling**: Robust error handling system
- š **Request Validation**: Express-validator integration
- š **Hot Reload**: Development server with nodemon
## Installation
Install the CLI tool globally to use it from anywhere:
```bash
npm install -g express-basic-starter
express-basic-starter <project-name>
```
Alternatively, you can use npx to run the tool without installing it globally:
```bash
npx express-basic-starter <project-name>
```
## Usage with ES Modules
To create a project using ES module syntax, use the --es flag:
```bash
npx express-basic-starter <project-name> --es
```
## Project Folder Structure
```
my-express-app
āāā app.js
āāā package.json
āāā package-lock.json
āāā .gitignore
āāā controllers
ā āāā sampleController.js
āāā docs
ā āāā swagger
ā āāā testDocs.js
āāā models
ā āāā sampleModel.js
āāā routes
ā āāā sampleRoute.js
āāā utils
ā āāā error.js
ā āāā jwt.js
ā āāā response.js
āāā uploads
```