UNPKG

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
# Express Basic Starter v2.0.0 [![npm version](https://badge.fury.io/js/express-basic-starter.svg)](https://badge.fury.io/js/express-basic-starter) [![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](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 ```