NestJS Code Snippets
A collection of NestJS snippets to boost productivity when building HTTP methods, modules, providers, and more.
Features
Quickly generate common NestJS patterns using short prefixes:
- NestJS Logger: Instantiate a logger typed with the current class name.
- Controller Boilerplate: Scaffold a CRUD controller with standard decorators.
- Service Boilerplate: Generate an
@Injectable() service structure.
Snippets Reference
| Prefix |
Description |
nest-module |
Create a Nest Module |
val-pipe |
Provide a good schema for Validation Pipe in main.ts file |
prefix |
Configure the global prefix for your application in main.ts file |
nest-provider |
Create a Nest Provider |
nest-controller |
Create a Nest Controller |
nest-logger |
Use the logger what NestJS recommend |
nest-get |
Create a GET method |
nest-post |
Create a Post method |
nest-put |
Create a Put method |
nest-Delete |
Create a Delete method |
Usage
- Open a TypeScript file (
.ts).
- Type any of the supported prefixes.
- Press
Tab or Enter to expand the snippet.
- Use
Tab to navigate through the parameters.
Requirements
No external dependencies required. Works natively with TypeScript Files.
Release Notes
0.0.1
- Basics Snippets for NestJS Applications
| |