npm.io
0.1.8 • Published 3 years agoCLI

nest-codegen

Licence
ISC
Version
0.1.8
Deps
4
Size
18 kB
Vulns
1
Weekly
0

Nest code generator

Description

Create custom modules for your nest aplication using the CLI.

Using the command:

$ nest-codegen generate module

Generates a dto and an entity inside the modules folder, and a folder inside your src module containing:

  • A repository folder, with index, a repository.interface and a repository
  • A service folder, with index, a service.interface and a service
  • A controller folder, with index, and a controller
  • A module file

Using the command:

$ nest-codegen generate test

Generates a folder inside the provided directory with

  • A dummies folder, with a repository mocking common functions (complete for your custom ones)
  • A integration folder for e2e tests
  • A unit folder for testing controllers and services

Installation

$ npm i -g nest-codegen
$ npm i --save nest-codegen

Usage

$ nest-codegen generate module
? What is the name of the module? Insert-name-here
? Path to the code, or leave blank for src/ (src)
$ nest-codegen generate test
? What is the name of the test module? Insert-test-name-here
? Path to the code, or leave blank for test/ (test)

Stay in touch

Keywords