// type-safe CRUD for NestJS
Ship NestJS CRUD APIs in minutes.
A generic CRUD controller & service, one query language across Mongoose, Prisma & TypeORM, built-in soft-delete & auditing, and a CLI that scaffolds production-ready apps.
$npm install -g @nest-extended/cli
service._find({
status: { $in: ['active'] },
$sort: { createdAt: -1 },
$limit: 20,
});model
.find({ status: { $in: ['active'] } })
.sort({ createdAt: -1 })
.limit(20);prisma.cat.findMany({
where: { status: { in: ['active'] } },
orderBy: { createdAt: 'desc' },
take: 20,
});repo.find({
where: { status: In(['active']) },
order: { createdAt: 'DESC' },
take: 20,
});Everything you need for CRUD APIs
Stop hand-writing the same controllers and services. nest-extended gives you the proven patterns, batteries included.
Generic CRUD
Extend NestController and NestService for instant find, get, create, patch and delete endpoints — pagination included.
Unified query language
FeathersJS-style operators ($in, $gte, $or, $iLike) that behave identically on Mongoose, Prisma and TypeORM.
Soft delete & auditing
Automatic createdBy / updatedBy / deletedBy tracking and non-destructive deletes you can restore.
Multi-database
MongoDB, PostgreSQL, MySQL and SQLite through Mongoose, Prisma or TypeORM — swap the ORM, keep your code.
JWT auth, generated
Opt in to an auth + users module scaffolded with @nestjs/jwt and bcrypt, plus request-scoped user context.
Smart exceptions
Database-aware error mapping (e.g. Prisma P2002 → friendly 409) and a null-to-404 response interceptor.
Type-safe generics
End-to-end TypeScript generics across controllers, services and DTOs — your models flow through everything.
CLI scaffolding
nest-cli generates apps, CRUD resources and auth with one command, wiring modules and best practices for you.
One service. Any database.
Pick Mongoose, Prisma or TypeORM — the service you write and the way you query are identical.
// cats.service.ts
import { Injectable } from '@nestjs/common';
import { InjectModel } from '@nestjs/mongoose';
import { Model } from 'mongoose';
import { NestService } from '@nest-extended/mongoose';
import { Cat, CatDocument } from './schemas/cat.schema';
@Injectable()
export class CatsService extends NestService<Cat, CatDocument> {
constructor(@InjectModel(Cat.name) model: Model<CatDocument>) {
super(model);
}
}// cats.service.ts
import { Injectable } from '@nestjs/common';
import { NestService } from '@nest-extended/prisma';
import { PrismaService } from '../prisma/prisma.service';
@Injectable()
export class CatsService extends NestService<any> {
constructor(private readonly prisma: PrismaService) {
super(prisma.cat);
}
}// cats.service.ts
import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
import { NestService } from '@nest-extended/typeorm';
import { Cat } from './entities/cat.entity';
@Injectable()
export class CatsService extends NestService<Cat> {
constructor(@InjectRepository(Cat) repo: Repository<Cat>) {
super(repo);
}
}And query with the same syntax
A single FeathersJS-style query object drives pagination, filtering, sorting and relation loading — translated to the right Mongoose, Prisma or TypeORM call under the hood.
// One query language — works the same on every adapter
const results = await service._find({
status: { $in: ['active', 'pending'] },
price: { $gte: 10, $lte: 100 },
name: { $iLike: 'phone' },
$or: [{ category: 'audio' }, { brand: 'acme' }],
$sort: { createdAt: -1 },
$limit: 20,
$include: { reviews: true },
});Less boilerplate. More shipping.
The same production features — without writing (and maintaining) them by hand on every project.
Vanilla NestJS
nest-extended
CRUD endpoints
Hand-written per resource
Generated by NestController
Pagination & sorting
Manual, per query
Built into every find
Filtering / query language
Custom per endpoint
One operator set everywhere
Soft delete & auditing
Wire it up yourself
Automatic createdBy / deletedBy
Switch database / ORM
Rewrite your services
Same API, swap the adapter
DB error handling
Manual try / catch
DB-aware exception filter
JWT auth & users
Build from scratch
Scaffolded on demand
Project scaffolding
Copy / paste boilerplate
nest-cli generators
From zero to a running API in one command
nest-cli g app scaffolds a production-ready NestJS project with sensible defaults — then add resources as you go.
NestJS app wired for your database & ORM
Soft-delete config, exception filter & null→404 interceptor
Optional JWT auth + users module
CRUD resources via nest-cli g service
Six focused packages
Install only what you need — a shared core, three database adapters, decorators, and a CLI.
Start building in minutes
Add nest-extended to an existing NestJS app, or scaffold a fresh one with the CLI.
$npm install @nest-extended/cli