npm.io
4.7.1 • Published 1 week agoCLI

express-api-rest-gen

Licence
ISC
Version
4.7.1
Deps
3
Size
25 kB
Vulns
0
Weekly
209

express-api-rest-gen

npm version npm downloads License: ISC Last Commit

A minimal and powerful CLI tool to generate a production-ready REST API with Express.js (JavaScript or TypeScript)

Features

  • Zero-configuration - Interactive CLI setup
  • Flexible - Choose between JavaScript or TypeScript
  • Production-ready - Best practices included
  • Fast - Generate your API in seconds
  • Well-structured - Clean project structure
  • Extensible - Easy to customize after generation

Table of Contents

Installation

Global Installation
npm i -g express-api-rest-gen

Requirements:

  • Node.js 22.0.0 or higher
  • npm 10.0.0 or higher

Quick Start

  1. Navigate to your desired directory

  2. Run the CLI generator:

express-api-rest-gen

alternatively, you can use npx:

npx express-api-rest-gen
  1. Follow the interactive prompts:

    • Project name - Your API project name
    • Language - Choose between JavaScript or TypeScript
    • Database - Select a database (MongoDB, PostgreSQL or MySQL)
    • Testing - Optionally include testing setup (Jest)
  2. Start coding:

cd your-project-name
npm start

Project Structure

your-project-name/
├── src/
│   ├── controllers/
│   ├── middleware/
│   ├── models/
│   ├── routes/
|   |── tests/
|   |── utils/ # Optional utility functions
|   |── validators/ # Optional validation logic
|   |── index.js (or index.ts) # Entry point
│   └── app.js (or app.ts) # Express app setup
├── .env
├── database.js (or database.ts) # Database connection setup
├── jest.config.js (if Testing selected)
├── package.json
├── package.lock.json
└── tsconfig.json (if TypeScript selected)

Contributing

Contributions are welcome! Please feel free to:

  • Report bugs and request features via GitHub Issues
  • Submit pull requests with improvements
  • Improve documentation
Development
git clone https://github.com/rubsuadav/express-api-rest-gen.git
cd express-api-rest-gen
npm i

License

This project is licensed under the ISC License - see the LICENSE file for details.

Keywords