modkit
Version:
CLI tool to generate boilerplate module files structure
134 lines (90 loc) âĸ 2.56 kB
Markdown
# đ§Š modkit
**modkit** is a lightweight CLI tool that helps developers quickly scaffold consistent and boilerplate-ready module structures for TypeScript-based Node.js applications.
Whether you're working on a monorepo or organizing your backend using clean architecture, `modkit` helps you save time by auto-generating files like `controller`, `service`, `model`, `route`, and more â all in one command.
## đ Features
- ⥠Super-fast module scaffolding
- đ§ą Consistent naming convention (`feature.type.ts`)
- đ Supports deeply nested paths (e.g. `src/modules/auth/user`)
- â
Zero configuration required
- đ Open-source & free forever
## đĻ Installation
### Using **npm**:
```bash
npm install -g modkit
```
### Or using **Yarn**:
```bash
yarn global add modkit
```
> âšī¸ If using Yarn, ensure `yarn global bin` is added to your PATH. You can check with:
>
> ```bash
> yarn global bin
> ```
## âī¸ Usage
```bash
modkit <target-path>
```
### Example:
```bash
modkit src/modules/user
```
### Output:
```
src/modules/user/
âââ user.controller.ts
âââ user.interface.ts
âââ user.model.ts
âââ user.route.ts
âââ user.service.ts
âââ user.validation.ts
```
Each file includes a basic default comment:
```ts
// user.service.ts
```
## đ Generated File Types
| File | Purpose |
| ----------------- | --------------------------------- |
| `*.controller.ts` | Route handler or controller logic |
| `*.interface.ts` | Interfaces & TypeScript types |
| `*.model.ts` | DB models or schema definition |
| `*.route.ts` | Express or route config |
| `*.service.ts` | Core business logic |
| `*.validation.ts` | Input validation logic |
## đ Development Setup
To work on `modkit` locally:
```bash
git clone https://github.com/webashraf/modkit
cd modkit
yarn install # or: npm install
```
### Run CLI in dev:
```bash
yarn start src/modules/example
```
### Build:
```bash
yarn build
```
### Link CLI for local testing:
```bash
yarn link
modkit src/modules/test
```
## đ¤ Contributing
We welcome contributions and suggestions!
- đ Report issues
- đ Star the repository
- ⨠Submit pull requests
## đ License
This project is licensed under the **ISC License**.
> Made with â¤ī¸ by Ali Ashraf