🚀 Explore all my extensions and guides: codingyari.com ✨
A dark-themed, optimized snippet pack that instantly generates:
- CRUD Controllers
- Authentication Flows
- User Model (bcrypt + JWT)
- JWT Middleware
- MongoDB Connection Helper
- Express Routes
- And much more...
⚡ Type a shortcut → Get full backend code — instantly.
nodejs-backend-snippets/
│
├── images/
│ ├── HeroDark.png
│ ├── ShortcutsDark.png
│ └── DemoDark.gif
│
├── snippets/
│ └── backend-snippets.json
│
├── package.json
├── CHANGELOG.md
└── README.md
| 🚀 Shortcut | 📝 Action |
|---|---|
ndc |
Create Controller |
ndg |
Get Controller |
ndu |
Update Controller |
ndd |
Delete Controller |
ndcurd |
All CRUD Controllers |
ndm |
Mongoose Model |
ndcu |
Register User |
ndcul |
Login User |
ndcug |
Get Profile |
ndcuu |
Update Profile |
ndco |
Logout User |
ndcum |
User Model (bcrypt + JWT) |
ndauth |
JWT Auth Middleware |
nddb |
MongoDB Connection Helper |
ndroute |
Express CRUD Router |
💡 Usage: Type shortcut → Press
TaborEnter.
controllers/
│
├── createData → ndc
├── getData → ndg
├── updateData → ndu
├── deleteData → ndd
└── CRUD Bundle → ndcurd
auth/
│
├── registerUser → ndcu
├── loginUser → ndcul
├── getProfile → ndcug
├── updateProfile → ndcuu
└── logoutUser → ndco
models/
│
├── User Model (bcrypt + JWT) → ndcum
└── Generic Model → ndm
middleware/
│
└── isAutherenticatedUser → ndauth
database/
│
└── connectDB.js → nddb
routes/
│
└── CRUD Router → ndroute
vsce package
code --install-extension nodejs-backend-snippets-*.vsixcp snippets/backend-snippets.json ~/.config/zed/snippets/nodejs-backend-snippets.jsonYou can easily add more code snippets and customize existing ones to fit your workflow! All snippets are stored in snippets/backend-snippets.json in JSON format.
-
Open the snippets file:
- Navigate to
snippets/backend-snippets.jsonin your project - Or find it in your VS Code extension folder
- Navigate to
-
Add a new snippet entry:
"Your Custom Snippet Name (shortcut)": { "prefix": "your-shortcut", "body": [ "export const yourFunction = async (req, res, next) => {", " // Your code here", " return res?.status(200).json({ success: true });", "};" ], "description": "Description of what this snippet does" }
-
Customize existing snippets:
- Edit any snippet in
backend-snippets.json - Change the
prefixto modify the shortcut - Modify the
bodyarray to change the generated code - Use
${1:placeholder}for tab stops (user can fill these in)
- Edit any snippet in
-
Reload your editor to apply changes
"Custom Validation Middleware (ndval)": {
"prefix": "ndval",
"body": [
"export const validateData = async (req, res, next) => {",
" const { ${1:field} } = req?.body ?? {};",
" if (!${1:field}) {",
" return res?.status(400).json({",
" success: false,",
" message: '${1:field} is required'",
" });",
" }",
" next();",
"};"
],
"description": "Custom validation middleware"
}💡 Tip: Follow the existing snippet patterns in
backend-snippets.jsonfor consistency. You can modify field names, add validation logic, change response formats, or create entirely new controller patterns!
- GitHub: https://github.com/codingyaari
- Website: https://codingyari.com
- Extensions: Full list on codingyari.com
- PRs Welcome
- Issues Welcome
- Custom snippet suggestions welcome
MIT — Free for personal & commercial use
