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

ncrudify

v1.4.1

Published

Configurable CRUD module for NestJS and Mongoose.

Readme

Crudify

npm NestJS MongoDB GitHub last commit GitHub issues GitHub stars

Are you a Mongoose lover but tired of writing the same CRUD code over and over again? Let Crudify do the heavy lifting for you! With this simple yet powerful NestJS library, you can instantly generate RESTful CRUD endpoints for your Mongoose models with just a few lines of code. Spend less time on boilerplate and more time building your application!

🚀 Why Crudify?

  • Tired of repetitive code? Crudify automatically generates the full set of CRUD operations for your Mongoose models. No more writing the same functions every time you need a new endpoint.
  • Swagger documentation out of the box! Crudify automatically generates a fully functional Swagger UI for your CRUD endpoints, making it easier for you and your team to test and document the API.
  • Highly customizable? Of course! You can extend and tweak the generated endpoints to meet your specific needs.
  • Error handling made easy: With an integrated logger, Crudify intercepts uncaught errors and makes debugging a breeze.
  • Designed for NestJS: Seamlessly integrates with your NestJS project, no friction, no fuss.

Installation

Ready to get started? Just install Crudify and let it work its magic:

npm install ncrudify

🙌 Features

  • No more boilerplate: Generate Create, Read, Update, and Delete operations automatically.
  • Swagger docs created for you: Just like that, Swagger UI will be set up automatically to interact with your API, making testing and documentation seamless.
  • Custom error handling: Built-in error handling with easy logging configuration.
  • Flexible: Customize the generated code or add your business logic.
  • NestJS integration: Perfectly fits into your existing NestJS projects.

Endpoints Automatically Created

Once you set it up, Crudify will handle these endpoints for you:

  • POST /your-model: Create a new record
  • POST /your-model/bulk: Create multiple new records
  • GET /your-model: Retrieve all records
  • GET /your-model/:id: Retrieve a specific record by ID
  • PATCH /your-model/:id: Update a record by ID
  • PATCH /your-model/bulk Update multiple records with filter in body
  • PUT /your-model/:id: Replace a record by ID
  • DELETE /your-model/:id: Delete a record by ID
  • DELETE /your-model/bulk Delete multiple records

💥 Get Started Now

If you’re done wasting time with repetitive CRUD code and ready to level up your NestJS game, Crudify is here for you. Let’s get started! 🚀

Configuring MongoDB with NestJS

If you haven't already configured MongoDB in your NestJS project, follow these steps:

  • Install Mongoose: First, you need to install the @nestjs/mongoose package and mongoose to connect to your MongoDB database:
npm install @nestjs/mongoose mongoose
  • Configure MongoDB in your NestJS module:

In your main application module (usually app.module.ts), import and configure the MongooseModule to connect to your MongoDB instance:


import { Module } from "@nestjs/common";
import { MongooseModule } from "@nestjs/mongoose";
import { UserModule } from "./user/user.module";

@Module({
	imports: [MongooseModule.forRoot(process.env.MONGODB_URI)],
})

export class AppModule {}

Setup Crudify

Make sure to add the following line in your main.ts file to enable extended query parsing with Express:

app.set('query parser', 'extended');

Without this line, certain query parameters used by Crudify (such as nested filters or arrays) may not work correctly.

Example

  • Define your Mongoose model: In this example, we define a User model using @nestjs/mongoose decorators and @nestjs/swagger for automatic API documentation.
import { Prop, Schema, SchemaFactory } from "@nestjs/mongoose";
import { ApiProperty } from "@nestjs/swagger";
import { Document, model, Model } from "mongoose";

@Schema({ timestamps: true })
export class User extends Document {
	@ApiProperty({ example: "John Doe", description: "The name of the user" })
	@Prop({ required: true })
	name: string;

	@ApiProperty({example: "[email protected]", description: "The email of the user"})
	@Prop({ required: true, unique: true })
	email: string;

	@ApiProperty({ example: 1, description: "The age of the user" })
	@Prop({ required: false })
	age: number;
}

export const UserSchema = SchemaFactory.createForClass(User);
export const UserModel: Model<User> = model <User> ("User", UserSchema);
  • Create your service:

Extend CrudifyService to benefit from the automatically generated CRUD methods. Override any methods if needed for custom logic, such as the findAll method in this example.

import { Injectable } from '@nestjs/common';
import { User } from './entities/user.entity';
import { FilterQuery, Model } from 'mongoose';
import { InjectModel } from '@nestjs/mongoose';
import { CrudifyService } from 'ncrudify';

@Injectable()
export class UserService extends CrudifyService<User> {
	constructor(@InjectModel(User.name) protected userModel: Model<User>) {
		super(userModel);
	}
}
  • Create your controller: Use the @Crudify decorator to automatically generate CRUD routes for the User model. You can still override specific methods like findAll as shown below.
import { Controller, Get } from '@nestjs/common';
import { UserService } from './user.service';
import { User, UserSchema } from './entities/user.entity';
import { Crudify, CrudifyController } from 'ncrudify';

@Crudify({
	model: {
		type: User,
		schema: UserSchema
	}
})
@Controller('users')
export class UserController extends CrudifyController<User> {
	constructor(public service: UserService) {
		super(service);
	}
}
  • Create your module:

Set up the module to import MongooseModule and register the User schema, while also providing the service and controller.

import { Module } from "@nestjs/common";
import { UserService } from "./user.service";
import { UserController } from "./user.controller";
import { MongooseModule } from "@nestjs/mongoose";
import { UserSchema } from "./entities/user.entity";

@Module({
	imports: [MongooseModule.forFeature([{ name: "User", schema: UserSchema }])],
	controllers: [UserController],
	providers: [UserService],
})

export class UserModule {}

Additional Configuration

For more configurations and documentation, visit the Crudify wiki.

Contributing

We love contributions! Whether you’ve spotted a bug or have an awesome idea, feel free to open an issue or submit a PR.

🤝 Sponsors

Support Crudify by becoming a sponsor! Sponsors will be featured here with links to their projects or companies. Reach out if you’d like to sponsor the project.


🧑‍💻 Contributing

We love contributions! Found a bug or have an idea? Open an issue or submit a PR.


❤️ Support

If you like this project, give it a ⭐ on GitHub or Buy Me A Coffee!


📜 License

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