Registry / database / nestjs-blueprint-crud

nestjs-blueprint-crud

JSON →
library1.0.12jsnpmunverified

A NestJS library for automatic CRUD operations with TypeORM, inspired by SailsJS Blueprint API and Waterline ORM. Current version: 1.0.12. Release cadence: irregular, maintained as open source on GitHub. Key differentiators: decorator-driven architecture with automatic Swagger/OpenAPI generation, full TypeScript support, enhanced endpoints (count, bulk, restore) beyond Sails.js blueprints, and association operations. Requires NestJS 10/11, TypeORM 0.3+, and peer dependencies for validation and Swagger.

npm install nestjs-blueprint-crud
INSTALL
IMPORT
SIG · NESTJS-BLUEPRINT-C
N
nestjs-blueprint-crud
databasejavascriptv1.0.12
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CrudModule
import { CrudModule } from 'nestjs-blueprint-crud'
const { CrudModule } = require('nestjs-blueprint-crud')
ESM-only package; CommonJS require will fail. Use TypeScript or ESM imports.
CrudService
import { CrudService } from 'nestjs-blueprint-crud'
Used to extend custom services with blueprint CRUD logic.
CrudProperty
import { CrudProperty } from 'nestjs-blueprint-crud'
import { CrudProperty } from 'nestjs-blueprint-crud/decorators'
Subpath exports are not supported; import directly from main package.

Setup of a NestJS module with TypeORM, CrudModule, and blueprint CRUD controller/service for a User entity.

// app.module.ts import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; import { CrudModule } from 'nestjs-blueprint-crud'; import { User } from './user.entity'; @Module({ imports: [ TypeOrmModule.forRoot({ type: 'sqlite', database: ':memory:', entities: [User], synchronize: true, }), CrudModule.forFeature([User]), ], }) export class AppModule {} // user.entity.ts import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm'; @Entity() export class User { @PrimaryGeneratedColumn() id: number; @Column() name: string; @Column() email: string; } // user.service.ts import { Injectable } from '@nestjs/common'; import { CrudService } from 'nestjs-blueprint-crud'; import { InjectRepository } from '@nestjs/typeorm'; import { Repository } from 'typeorm'; import { User } from './user.entity'; @Injectable() export class UserService extends CrudService<User> { constructor( @InjectRepository(User) protected readonly repository: Repository<User>, ) { super(repository); } } // user.controller.ts import { Controller } from '@nestjs/common'; import { CrudController } from 'nestjs-blueprint-crud'; import { UserService } from './user.service'; import { User } from './user.entity'; @Controller('users') export class UserController extends CrudController<User>({ entity: User, service: UserService, }) {} // main.ts import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module'; async function bootstrap() { const app = await NestFactory.create(AppModule); // Enable Swagger if needed using @nestjs/swagger await app.listen(3000); } bootstrap();
Debug
Known issues
breakingRequires Node >=18.0.0 and npm >=9.0.0
fix
Update Node.js to version 18+ and npm to version 9+.
affects: >=1.0.0
deprecatedpeerDependencies allow @nestjs/swagger v7 to v11; older versions may lack OpenAPI features
fix
Use @nestjs/swagger v10 or v11 for best compatibility.
affects: >=1.0.0
gotchaCrudModule.forFeature() expects entities to be registered with TypeOrmModule first
fix
Ensure each entity used in CrudModule.forFeature() is also imported via TypeOrmModule.forRoot() or TypeOrmModule.forFeature().
affects: >=1.0.0
breakingPackage is ESM-only; CommonJS require() will not work
fix
Use 'import' syntax and set 'type': 'module' in package.json, or use a dynamic import.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'nestjs-blueprint-crud' or its corresponding type declarations.
Package is ESM-only and the consuming project is not configured for ESM or lacks 'type': 'module'.
fix
Add 'type': 'module' to project's package.json or use .mjs extension; ensure TypeScript 'module' is set to 'Node16' or 'NodeNext'.
Nest can't resolve dependencies of the CrudService (?, ?). Please verify that the [object Object] argument is available in the current context.
The entity's repository is not provided to the service context because TypeOrmModule.forFeature() is missing.
fix
Import TypeOrmModule.forFeature([YourEntity]) in the module where the service is used.
TypeError: Class extends value undefined is not a constructor or null
The entity class is not being imported correctly, causing CrudController to receive undefined.
fix
Ensure the entity class is exported and imported correctly; check for circular dependencies.
Upgrade
Version history
1.0.12latest on npm
Audit
Dependencies
@nestjs/commonrequiredPeer dependency - NestJS common module required for decorators, pipes, interceptors
@nestjs/corerequiredPeer dependency - NestJS core required for module metadata and dependency injection
@nestjs/swaggerrequiredPeer dependency - Used for automatic OpenAPI documentation generation
class-transformerrequiredPeer dependency - Required for DTO serialization and transformation
class-validatorrequiredPeer dependency - Required for DTO validation
reflect-metadatarequiredPeer dependency - Required for NestJS decorators and TypeORM reflection
typeormrequiredPeer dependency - ORM for database operations
Agent activity
4 hits · last 30 days
node
4
Resources
nestjs-blueprint-crud — npm install nestjs-blueprint-crud · libregistry