1.0.6 • Published 10 months ago

suni-cli v1.0.6

Weekly downloads
-
License
ISC
Repository
-
Last release
10 months ago

CLI for suni

Installation

npm install -g suni-cli

Generate service

Make sure you are under src/modules directory

cd <path-to-project>/src/modules

Run command

suni service --model <model-name> <service-name>

For example:

suni service --model User user-service

Generate new model

Make sure you are under service directory

cd <path-to-project>/src/modules/<service-name>

Run command

suni model <model-name> <type>

There, type is one of sql, dynamo

For example:

suni model User sql

This command should generate models/User.ts and providers/database/sequelize/models/UserModel.ts.

Generate new repository

Make sure you are under service directory

suni repo <model-name>

For example:

suni repo User

This command should generate repositories/interfaces/UserRepository.ts and repositories/UserRepositoryImpl.ts.

Generate single usecase

Make sure you are under service directory

suni usecase single <usecase-name>

For example:

suni usecase single MyUseCase

This command should generate useCases/interfaces/MyUseCase.ts and useCases/MyUseCaseImpl.ts.

Generate CLRUD usecases (Create, List, Retrieve, Update, Delete)

Make sure you are under service directory

suni usecase clrud <model-name>

For example:

suni usecase clrud User

This command should generate interfaces and implementations for creating/listing/retrieving/updating/deleting a model.