sanjeet-server
v1.0.3
Published
A **CLI tool** to generate a fully-configurable Express.js project with useful utilities like **CORS**, **dotenv**, **cookie-parser**, and more. This generator allows you to quickly scaffold a project with essential folders, middleware, and configuration.
Downloads
244
Readme
Express.js Project Generator
A CLI tool to generate a fully-configurable Express.js project with useful utilities like CORS, dotenv, cookie-parser, and more. This generator allows you to quickly scaffold a project with essential folders, middleware, and configuration.
Features
- Generate a ready-to-use Express.js server.
- Optional features:
- CORS for cross-origin requests.
- Cookie-parser for cookie management.
- dotenv for environment variable management.
- morgan for logging requests.
- Includes helpful utilities:
- ApiError class for structured error handling.
- ApiResponse class for consistent API responses.
- Async handler to manage asynchronous functions gracefully.
- Pre-configured with:
- Nodemon for auto-restarting the server in development mode.
- Essential project structure with
routes
,models
,controllers
, etc.
Project Structure
/project-name
│
├── /src
│ ├── /routes
│ ├── /models
│ ├── /controllers
│ ├── /middlewares
│ └── /utils
│ ├── ApiError.js
│ ├── ApiResponse.js
│ └── asyncHandler.js
├── app.js
├── .env (if enabled)
├── package.json
└── README.md
Prerequisites
- Node.js installed (v14+ recommended).
- NPM or Yarn installed.
- Internet connection to download dependencies.
Installation
Clone or Download the Project:
npx sanjeet-server
cd sanjeet-server npm install
Contributing
Feel free to fork this repository, open issues, and submit pull requests to improve the project.
Author
Created with ❤️ by Sanjeet Kumar.