RESTful APIs for NestJS — from a single @Crud() decorator
Eight RESTful endpoints for any NestJS controller: list, paginate, filter, sort, join, nested-join, soft-delete, recover. Zero handlers to write.
- CRUD controllers and services you extend, not scaffolds you own
- DB and service agnostic. Base classes per adapter
- Query parsing: filters, pagination, sort, relations, nested relations, cache
- Pluggable cache: Redis, ioredis, Prisma Accelerate, or bring your own
- Framework-agnostic query builder for the frontend
- Body, query, and path-param validation included
- Override any generated handler with
@Override() - Small config. Per-controller or global defaults
- Swagger docs auto-wired (optional peer)
npm install @nestjs-crud/core @nestjs-crud/typeorm@Crud({
model: { type: User },
query: { limit: 25, maxLimit: 100, join: { profile: { eager: true } } },
})
@Controller('users')
export class UsersController {
constructor(public service: UsersService) {}
}You get GET /users, GET /users/:id, POST /users, POST /users/bulk, PATCH /users/:id, PUT /users/:id, DELETE /users/:id, and POST /users/:id/recover. Each route ships with query parsing, validation, and pagination built in. Swagger appears automatically when @nestjs/swagger is installed.
| Adapter | Package | Docs |
|---|---|---|
| TypeORM | @nestjs-crud/typeorm |
ServiceTypeorm |
| Drizzle | @nestjs-crud/drizzle |
ServiceDrizzle |
| MikroORM | @nestjs-crud/mikro-orm |
ServiceMikroOrm |
| Prisma | @nestjs-crud/prisma |
ServicePrisma |
Plus @nestjs-crud/core (decorator + framework, see Controllers) and @nestjs-crud/request (frontend query builder, see Requests).
- v2.x (current): released on npm as
@nestjs-crud/*@2.x, active development onmaster. Adds the Prisma adapter, a sharedQueryTranslatorcore, tighter types, and real-DB integration tests. - v1.0.x (maintenance): drop-in replacement for
@nestjsx/crud. Same API, modernized dependencies, security patches, runs on NestJS 11. Moving off the base library? Install@nestjs-crud/*@1.0.xand you're done, no code changes. Browse thev1.0.2tag or branch. Backports land there only if needed.
Moving off @nestjsx/crud? Step first to @nestjs-crud/*@1.0.x (same API, zero code changes), then decide whether to take the breaking-change upgrade to @nestjs-crud/*@2.x via the v1 → v2 guide. Already on v2.0? The v2.0 → v2.1 guide covers the Prisma-v7 consumer migration.
Full docs live on the Wiki. Main sections:
- Why nestjs-crud
- Controllers · Services · Requests · Query syntax
- Swagger setup · Caching · Logging · Relation load strategy · Pagination (offset, cursor)
- Migration guides: v1 → v2 · v2.0 → v2.1
Three agent skills ship alongside the library:
| Skill | Scope |
|---|---|
nestjs-crud |
Current v2.x: setup, adapters, @Crud() options, Swagger customization, transactions, common issues |
nestjs-crud-v1 |
Legacy v1.0.x behavior reference |
nestjs-crud-migration |
v1 → v2 upgrade playbook: audit greps, error-to-fix mapping |
# all three
npx skills add kodjunkie/nestjs-crud
# one at a time
npx skills add kodjunkie/nestjs-crud -s nestjs-crud
npx skills add kodjunkie/nestjs-crud -s nestjs-crud-migrationBuilt on the work of Michael Yali and the @nestjsx/crud contributors. Fork point: upstream 5.0.0-alpha.3. See NOTICE.md for the full fork history.
MIT. The upstream author's 2018-Present copyright and the fork maintainer's 2026-Present copyright both apply. Keep both notices intact if you fork.
