@nestbolt/taggable
Installation
Install @nestbolt/taggable and its required and optional peer dependencies.
Install the Package
Install @nestbolt/taggable using your preferred package manager:
npm install @nestbolt/taggableyarn add @nestbolt/taggablepnpm add @nestbolt/taggablePeer Dependencies
The following packages are required peer dependencies. In a typical NestJS project, most of these are already installed:
| Package | Required Version | Purpose |
|---|---|---|
@nestjs/common | ^10.0.0 || ^11.0.0 | NestJS core decorators and utilities |
@nestjs/core | ^10.0.0 || ^11.0.0 | NestJS application core |
@nestjs/typeorm | ^10.0.0 || ^11.0.0 | TypeORM integration for NestJS |
typeorm | ^0.3.0 | ORM used for entities and repositories |
reflect-metadata | ^0.1.13 || ^0.2.0 | Metadata reflection for decorators |
Install any missing peer dependencies:
npm install @nestjs/common @nestjs/core @nestjs/typeorm typeorm reflect-metadataOptional Dependencies
Event Emitter (Tag Lifecycle Events)
Required if you want to listen to tag events such as tag.created, tag.deleted, tag.attached, and tag.detached.
npm install @nestjs/event-emitterSupported versions: ^2.0.0 || ^3.0.0
You also need to register the EventEmitterModule in your application:
import { EventEmitterModule } from "@nestjs/event-emitter";
@Module({
imports: [
EventEmitterModule.forRoot(),
// ... other imports
],
})
export class AppModule {}If @nestjs/event-emitter is not installed, the package works normally but no events are emitted. The event emitter is injected as an optional dependency.
Verifying the Installation
After installing, verify everything is wired correctly by importing the module in your root AppModule:
import { Module } from "@nestjs/common";
import { TypeOrmModule } from "@nestjs/typeorm";
import { TaggableModule } from "@nestbolt/taggable";
@Module({
imports: [
TypeOrmModule.forRoot({
type: "postgres",
// ... your database config
synchronize: true, // development only
}),
TaggableModule.forRoot(),
],
})
export class AppModule {}If the application starts without errors and you see TaggableService initialized in the logs, the installation is complete. Continue to the Quick Start guide to start tagging your entities.