gnest-cli v0.1.10-alpha.1
GNest CLI
GNest CLI is a command-line tool for generating common files used in NestJS projects.
Installation
To install GNest CLI, you must first have Node.js and npm installed. Then, run the following command:
npm install -g gnest-cliAvailable Commands
DTO
The dto command generates a DTO file with the specified name in the /src/dto folder.
Usage
gnest-cli dto [file-name]Example
gnest-cli dto create-userCommands
Core
| Command | Abbr. | Path |
|---|---|---|
| dto | d | core/dto/ |
| entity | e | core/entities/ |
| interface | i | core/interfaces/ |
| use-case | uc | core/use-cases/ |
Data
| Command | Abbr. | Path |
|---|---|---|
| model | m | data/models/ |
| repository | r | data/repositories/ |
App
| Command | Abbr. | Path |
|---|---|---|
| module | N/A | / |
| controller | N/A | / |
Others
| Command | Abbr. | Path |
|---|---|---|
| resource | N/A | / |
Directory Structure
module/
├── core/
│ ├── dto/
│ │ └── file.dto.ts
│ ├── entities/
│ │ └── file.entity.ts
│ ├── interfaces/
│ │ └── i-file.service.ts
│ └── use-cases/
│ └── create-file.case.ts
├── data/
│ ├── models/
│ │ └── file.model.ts
│ └── repositories/
│ └── file.repository.ts
├── file.controller.ts
└── file.module.tsThis is a custom directory structure for a NestJS module that includes a core and data folder. The core folder contains the business logic of the module, including DTOs, entities, interfaces, and use cases. The data folder contains data-related files such as models and repositories. Finally, the stores.controller.ts and stores.module.ts files are responsible for exposing the module's endpoints and for registering the module as a provider within the application.
Contributions
If you want to contribute to this project, feel free to fork it and send your pull requests!
License
This project is licensed under the MIT License. See the LICENSE file for more information.
Author
This CLI tool was created by jhonvegamas for personal use. Feel free to use it and modify it according to your needs. If you find any issues or have any suggestions for improvement, please open an issue or a pull request on the gnest-cli. Thank you for using GNest CLI!
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago