Skip to content

Hesham1902/generator-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nest.js Middleware Generator CLI

This command-line interface (CLI) tool allows you to generate Nest.js middleware, interceptors, and guards with ease.

Installation

To install the CLI tool, run the following command:

npm install -g @pireb/generator-cli

Usage

Generate Middleware, Interceptor, or Guard

To generate a new middleware, interceptor, or guard file, use the following command:

generator-cli add <type> <name> [-m, --module <module>]
  • <type>: Specify the type of file to generate (middleware, interceptor, or guard).
  • <name>: Specify the name of the file.
  • <module> (optional): Specify the module in which the file should be created.

Example:

generator-cli add middleware Auth

This command will generate a middleware file named auth.middleware.ts in the src directory.

To specify the module, use the -m or --module option:

generator-cli add interceptor Logging -m logger

This command will generate an interceptor file named logging.interceptor.ts in the src/logger directory.

generator-cli add guard Admin -m auth

This command will generate the guard file in the src/auth directory.

Options

  • -m, --module <module>: Specify the module in which the file should be created.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published