Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Pratics NestJS snippets for VS Code editor + ExpressJS snippetsNew to Visual Studio Code? Get it now.
Pratics NestJS snippets for VS Code editor + ExpressJS snippets

Pratics NestJS snippets for VS Code editor + ExpressJS snippets

Estevam Souza

|
7,526 installs
| (0) | Free
| Sponsor
Snippets for NestJS + ExpressJS in VS Code editor
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Nestjs Snippets for VS Code Version

Nest Logo Simple snippets pack to increase your productivity when developing with nestjs

Marketplace Installs Rating


Created by Manu Codes

Make your life easier, use code actions to do repetitive tasks for you! They can help a lot, just follow the light bulb 💡!

Prerequisite

  • Node.js
  • Nest.js
  • TypeScript
  • VS Code
  • Nest.js Snippets

Sponsor

I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously, this takes time. You can use this service for free.

However, if you are using this project and are happy with it or just want to encourage me to continue creating stuff, there are a few ways you can do it:-

  • Giving proper credit when you use github-readme-stats on your readme, linking back to it :D
  • Starring and sharing the project :rocket: I'll probably buy a ~~coffee~~ tea. :tea:

GitHub Sponsor

Installation

  1. Open Extensions sidebar panel in VS Code. View → Extensions
  2. Search for Nest.js Snippets
  3. Click Install to install it.
  4. Code your Nest.js app.
  • Open the Command Palette (⇧⌘P (Windows, Linux Ctrl+Shift+P)) and type nest to see all available commands.

Note: If you have any issues, please report it.

Can also be installed using the command line

code --install-extension nestjs-snippets

JavaScript Snippet Pack for Visual Studio Code

Download this extension from the Visual Studio Code Marketplace

Supported languages (file extensions)

  • TypeScript (.ts)
  • JavaScript (.js)
  • JavaScript Next (.jsx)
  • TypeScript React (.tsx)

Snippets

Below is a list of all available snippets and the triggers of each one. The ⇥ means the TAB key. The ⏎ means the ENTER key. The ␣ means the SPACE key.

MERN-Snippets 🤓

Nestjs Snippets for Visual Studio Code. Using this extension you can quickly create Nestjs boilerplate code. 🚀 😎 Includes snippets for:

  • Controllers
  • Services
  • Providers
  • Modules
  • Guards
  • Interceptors
  • Pipes
  • Filters
  • Exceptions
  • DTOs
  • Entities
  • Repositories
  • Factories
  • Interfaces
  • Enums
  • Constants
  • Configs
  • Middlewares
  • Schemas
  • Resolvers

Usage

This VSCode extension is a collection of snippets for the nestjs framework.

Nest Logo

  1. Install the extension
  2. You will get suggestion when you type the commands
  3. Hit Tab or Enter

Command

Nestjs Snippets Commands using ns prefix

ns + tab or enter

  • command: ns
  • description: Nestjs Snippets
  • prefix: ns
Trigger Content
nsctl-> Nestjs Controller
nssql-> Sequelize Nestjs @nestjs/sequelize
nssqlpr-> Nestjs Provider
nstst-> Nestjs Test
nsmg-> using mooogose @nestjs/mongoose
nsmssvc-> Nestjs Service Mongoose
nsrp-> Nestjs Repository
nsent-> Entity Nestjs
nsctexp-> Custom Exception Nestjs
nse-> Nestjs Enum
nsdto-> Nestjs DTO
nsdtoup-> Update Nestjs DTO
nsdtocreate-> Create Nestjs DTO
nsdtoquery-> Query Nestjs DTO
nsdtoquerypag-> Query Pagination Nestjs DTO
nsdtoquerypagsortfil-> Query Pagination Sort Filter Nestjs DTO
nsdtoquerypagsortfilsea-> Query Pagination Sort Filter Search Nestjs DTO
nslgg-> Logger Nestjs
nsctdec-> Decorator Nestjs
nsjwtstr-> JWT Strategy Nest
nspp-> Pipe Nestjs
nsdmd-> Dni Module Nestjs
nsflt-> Filter Nestjs
nsprd-> Provider Nestjs
nsgd-> Guard Nestjs
nsitpr-> Interceptor Nestjs
nsrtmd-> Root module Nestjs
nsmdlwr-> Middleware Nestjs
nsvc-> Service Nestjs
nsmd-> Module Nestjs
nsmdip-> Import Module Nestjs
nsmdipadd-> Import Add Module Nestjs
nstpcnn-> Typeorm Connection Nestjs
nstprp-> Typeorm repository Nestjs
nstprpimp-> Typeorm import repository Nestjs
nsprismasvc-> Prisma Service Nestjs
nsqlsrv-> Sequelize Service Nestjs
nsmgsrcv2-> Mongo Service Nestjs
nsswgg-> Swagger Nestjs
nsjwt-> JWT Nestjs
nsbcrt-> Bycrypt Nest
nsmlr-> Mailer Nestjs
nsvaldcll-> Class Validator Nestjs
nsvalmthd-> Validation Method Nestjs

Examples

Controller Example:

import { Controller, Get, Post, Put, Delete, Param, Body } from '@nestjs/common';


@Controller('$1')
export class $2Controller {
  @Get()
  findAll(): string {
    return 'This action returns all $1';
  }

  @Get(':id')
  findOne(@Param('id') id): string {
    return 'This action returns a #${id} $1';
  }

  @Post()
  create(@Body() $1Data): string {
    return 'This action adds a new $1';
  }

  @Put(':id')
  update(@Param('id') id @Body() $1Data): string {
    return 'This action updates a #${id} $1';
  }

  @Delete(':id')
  remove(@Param('id') id): string {
    return 'This action removes a #${id} $1';
  }
}

Express Snippets Commands using es prefix

es + tab or enter

  • command: es
  • description: Express Snippets
  • prefix: es
Trigger Content
esr-> Express Router
esrget-> Express Router Get
esrpost-> Express Router Post
esrput-> Express Router Put
esrpatch-> Express Router Patch
esrdelete-> Express Router Delete
esrall-> Express Router All
esruse-> Express Router Use
esrparam-> Express Router Param
esrparams-> Express Router Params
esrquery-> Express Router Query
esrhead-> Express Router Head
esrpath-> Express Router Path
esrroute-> Express Router Route
esrstack-> Express Router Stack
esrapp-> Express Router App
esrparent-> Express Router Parent
esrpath-> Express Router Path

Examples

Express Router Example:

import express from 'express';

const router = express.Router();

router.get('/', (req, res) => {
  res.send('Hello World!');
});

export default router;

Mongoose Snippets Commands using ms prefix

ms + tab or enter

  • command: ms
  • description: Mongoose Snippets
  • prefix: ms
Trigger Content
msm-> Mongoose Model

How to develop

  1. Clone the repository
  2. Open the repository in VS Code
  3. Run npm install
  4. Run npm run watch
  5. Press F5 to open a new window with your extension loaded
  6. Make changes to src/extension.ts or create new ones under src/
  7. You can reload the window with Ctrl+R or by clicking on the reload button in the debug toolbar
  8. You can launch the extension from the debug toolbar with the green play button
  9. You can run tests from the debug toolbar with the blue play button

How to package

  1. Run npm run package
  2. Find the .vsix file in the dist folder
  3. Install the .vsix file in VS Code by running code --install-extension <name>.vsix
  4. You can also install the .vsix file by opening the extensions view in VS Code and clicking on the ... menu in the top right corner of the view

Contributing

If you have any suggestions or find any bugs, please create an issue or pull request.

👨‍🚀 Author

👋 My Contacts:

Linkedin Badge Gmail Badge

Made with ❤️ by Estevam Souza

Contributors



Changelog

0.0.4

  • Added Apollo GraphQL Snippets
  • Added MISC Snippets
  • Added React Snippets

0.0.3

  • Added GraphQL Snippets
  • Added MongoDB + Mongoose + Prism Snippets
  • TypeORM + NestJS + Sequelize + TypeGraphQL + JWT + Bcrypt + Mailer + Class Validator + Swagger + Prisma + GraphQL + MongoDB + Mongoose + Apollo GraphQL + React + MISC Snippets

0.0.2

  • Added more snippets ⚡️(Express)
  • Added more documentation 📝
  • Updated Docs 📖

0.0.1

  • Initial release 🎉

Initial release of MERN snippets

Enjoy! 🎉🎊

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft