Drop-in module, instant CRUD routes, and elegant overrides when you need full control.
TypeORM today, Sequelize-ready tomorrow—swap ORM or validators without upheaval.
Entity-driven schemas with polished response envelopes for list, details, create, update, delete.
@UseCrud({ models: [...] }). See README for overrides, include/exclude, and model-first usage.$ npm i crudman-nestjs
// users.controller.ts
import { Controller } from '@nestjs/common'
import { UseCrud, CrudControllerBase } from 'crudman-nestjs'
import { User } from './user.entity'
@UseCrud({ sections: { users: { model: User } } })
@Controller('api/users')
export class UsersController extends CrudControllerBase('users') {}
Use these presets in uploadable or typeHint. Override MIME/ext/size per field via validators. Avatar presets also enforce image dimensions.
| Type | Allowed MIME types | Extensions | Max size (MB) | Image constraints | Notes |
|---|---|---|---|---|---|
| image | jpeg, png, gif, webp, avif | .jpg,.jpeg,.png,.gif,.webp,.avif | 5 | — | group |
| image-jpg | image/jpeg | .jpg,.jpeg | 5 | — | |
| image-png | image/png | .png | 5 | — | |
| image-gif | image/gif | .gif | 5 | — | |
| image-webp | image/webp | .webp | 5 | — | |
| image-avif | image/avif | .avif | 5 | — | |
| image-avatar | jpeg, png, gif, webp, avif | .jpg,.jpeg,.png,.gif,.webp,.avif | 2 | min 128x128, max 4096x4096, aspect ~1:1 | avatars |
| video | video/mp4, video/webm, video/ogg | .mp4,.webm,.ogg | 100 | — | |
| video-short | video/mp4, video/webm | .mp4,.webm | 25 | — | short clips |
| audio | audio/mpeg, audio/mp4, audio/aac, audio/ogg, audio/wav | .mp3,.m4a,.aac,.ogg,.wav | 20 | — | |
| — | 10 | — | |||
| doc | — | .pdf,.doc,.docx,.odt | 10 | — | |
| spreadsheet | — | .xls,.xlsx,.csv | 10 | — | group |
| spreadsheet-csv | text/csv | .csv | 5 | — | |
| spreadsheet-xls | application/vnd.ms-excel | .xls | 10 | — | |
| spreadsheet-xlsx | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | .xlsx | 10 | — | |
| csv | text/csv | .csv | 5 | — | |
| xml | application/xml, text/xml | .xml | 2 | — | |
| html | text/html | .html,.htm | 2 | — | |
| json | application/json | .json | 2 | — | |
| text | text/plain, text/markdown | .txt,.md | 2 | — | |
| archive | — | .zip,.tar,.gz,.rar,.7z | 200 | — | |
| binary | application/octet-stream | any | 50 | — | raw blobs |
Default storage: filename_in_field (relative key saved in the entity field). Responses include meta.baseUrls on list/details; clients can set x-file-url=full|key_only to indicate URL preference.