Module Creation
Discover how to create modules in NestJS.
Build the first module
We used the NestJS CLI command in the previous lesson to create a new app. In this lesson, we’ll delve into the commands and options of CLI and explore how to use them in order to create and structure modules efficiently.
NestJS CLI
NestJS CLI is a command line tool that helps developers work with NestJS. It provides a set of commands to generate boilerplate code, scaffold a new app, and perform other tasks like generating resources.
Commands and options
The most common CLI command is the generate
command. Using the generate
(g
) command, we can create a new controller, decorator, guard, service, and more.
To get a list of the generate
command options, run the following command to find out the usage of the generate
command:
Get hands-on with 1400+ tech skills courses.