New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

nestjs-gen

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nestjs-gen

NestJS model package generator

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
79
increased by14.49%
Maintainers
1
Weekly downloads
 
Created
Source

Install:

npm install rw3iss/nestjs-gen
Generate a module / package contents / whatever:
node ./node_modules/nestjs-gen/index.js gen <name> <options>

This will generate a folder within a subdirectory according to options. See below for examples.

Examples:

Generate Module with all Features (controller, service, repository, model):
node ./node_modules/nestjs-gen/index.js gen example --all --prefix "src"

This will generate:

./modules/example/example.module.js
./modules/example/example.controller.js
./modules/example/example.service.js
./modules/example/example.repository.js
./modules/example/models/example.model.js
(and corresponding CRUD interface within controller and service)

(Use --prefix to place files within the prefix directory, from the current folder)

Generate just Controller, Repository, and Test model (no module)
node ./node_modules/nestjs-gen/index.js gen example --crud

This will generate:

./example/example.controller.js
./example/example.repository.js
./example/models/example.model.js
(and corresponding CRUD interface within controller and service)

(If you want things in their own module, just specify --module)

Options:

 --p <prefix>           Specify root/prefix dir to generate in                                optional
 --prefix <prefix>      Specify root/prefix dir to generate in                                optional
 
 --a                    Generate all (module + controller + service + repository + model      optional      default: false
 --all                  Generate all (module + controller + service + repository + model      optional      default: false
 
 --m                    Generate a module                                                     optional      default: false
 --module               Generate a module                                                     optional      default: false
  
 --r                    Generate a repository for the model                                   optional      default: false
 --repo                 Generate a repository for the model                                   optional      default: false
 --repository           Generate a repository for the model                                   optional      default: false
 
 --md                   Generate the model files                                              optional      default: false
 --model                Generate the model files                                              optional      default: false
 --model-name           Specify the exact name for the model class                            optional      default: false
 
 --c                    Generate a controller for the model                                   optional      default: false
 --controller           Generate a controller for the model                                   optional      default: false
 
 --s                    Generate a service for the model                                      optional      default: false
 --service              Generate a service for the model                                      optional      default: false
 
 --crud                 Generates CRUD actions within the controller and service              optional      default: false
 
 --auth                 CRUD actions will require a logged in user                            optional      default: false
 --auth-guard-class     The name of the Guard class                                           optional      default: false
 --auth-guard-location  The location of the Guard class                                       optional      default: false

 --no-model-dir         Don't put models in "models" subdirectory                             optional      default: false

Keywords

FAQs

Package last updated on 26 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc