npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

nest-crud-repository-pattern

v1.0.0

Published

A powerful NestJS CRUD generator implementing the Repository Pattern with support for multiple ORMs

Readme

NestJS CRUD Generator 🚀

A powerful and user-friendly CLI tool that generates complete CRUD operations for NestJS applications with support for multiple ORMs.

Features ✨

  • 🛠️ Generates complete CRUD operations
  • 🔌 Supports multiple ORMs:
    • TypeORM
    • Prisma
    • Mongoose
    • Sequelize
    • MikroORM
  • 📁 Creates all necessary files:
    • Controller
    • Service
    • Repository
    • Entity
    • DTOs
    • Module
  • 🤖 Automatic dependency installation
  • 🎨 Clean and consistent code structure

Installation 📦

bash

npm install -g nestjs-crud-generator

Quick Start 🏃‍♂️

  1. Open your terminal
  2. Navigate to your NestJS project:

bash cd your-nestjs-project 3. Run the generator:

bash nest-crud-gen generate or use the shorthand:

bash nest-crud-gen g

Step-by-Step Guide 📝

1. Enter Resource Name

When prompted, enter the name of your resource (e.g., "user", "product", "order").

Example:

bash ? Enter the resource name: user

2. Select ORM

Choose your preferred ORM from the list:

  • TypeORM
  • Prisma
  • Mongoose
  • Sequelize
  • MikroORM

Example:

bash ? Which ORM would you like to use? ❯ TypeORM - Most popular ORM for TypeScript/Node.js Prisma - Modern DB toolkit with type safety Mongoose - Elegant MongoDB ODM Sequelize - Feature-rich ORM for SQL databases MikroORM - TypeScript ORM with Identity Map pattern

3. Wait for Generation

The tool will:

  1. Install required dependencies
  2. Generate all necessary files
  3. Set up proper configurations

Generated Files Structure 📁

src/ └── your-resource/ ├── dto/ │ ├── create-your-resource.dto.ts │ └── update-your-resource.dto.ts ├── entities/ │ └── your-resource.entity.ts ├── your-resource.controller.ts ├── your-resource.service.ts ├── your-resource.repository.ts └── your-resource.module.ts

Example Usage 💡

Let's create a complete CRUD for a "product" resource:

  1. Run the generator:

bash nest-crud-gen g

  1. Enter details:

bash ? Enter the resource name: product ? Which ORM would you like to use? TypeORM

  1. The generator will create:
  • ProductController with all CRUD endpoints
  • ProductService with business logic
  • ProductRepository for database operations
  • Product entity with basic fields
  • DTOs for create and update operations
  • ProductModule with proper configurations
  1. Your endpoints will be available at:
  • GET /product - Get all products
  • GET /product/:id - Get one product
  • POST /product - Create product
  • PATCH /product/:id - Update product
  • DELETE /product/:id - Delete product

Customization 🎨

After generation, you can:

  1. Add more fields to the entity
  2. Modify validation in DTOs
  3. Add custom methods to the service
  4. Extend controller functionality

Troubleshooting 🔧

Common Issues

  1. Dependencies Installation Failed

bash npm install --legacy-peer-deps [missing-dependencies]

  1. Type Errors Make sure to install all type definitions:

bash npm install @types/node -D

  1. Path Issues Ensure you're running the command in your NestJS project root.

Support 🤝

If you encounter any issues or need help:

  1. Check our GitHub Issues
  2. Email us at: [email protected]

Contributing 🌟

We love contributions! To contribute:

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License 📄

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

Author ✍️

[Your Name]

Acknowledgments 👏

Special thanks to:

  • NestJS team
  • All contributors
  • Our amazing community

Made with ❤️ for the NestJS community