@idebug/nest (NestJS)
Nest integration on the same core store and UI as Express.
Install
pnpm add @idebug/nest @nestjs/common @nestjs/core @nestjs/platform-express
pnpm --filter @idebug/ui buildModule setup
import { Module } from '@nestjs/common';
import { IDebugModule } from '@idebug/nest';
import { AppController } from './app.controller';
import { AppService } from './app.service';
@Module({
imports: [
IDebugModule.forRoot({
enabled: true,
appName: 'my-nest-api',
performance: true,
db: true,
}),
],
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}IDebugModule.register is an alias of forRoot.
@Loggable()
import { Injectable } from '@nestjs/common';
import { Loggable } from '@idebug/nest';
@Injectable()
export class CalcService {
@Loggable()
add(a: number, b: number) {
return a + b;
}
@Loggable()
divide(a: number, b: number) {
if (b === 0) throw new Error('Division by zero is not allowed');
return a / b;
}
}Emits functionCall enter and exit into the shared store (uses module config from forRoot, not a fresh config instance).
What gets registered
| Piece | Behavior |
|---|---|
| Global middleware | ALS + req/res + UI at basePath |
PerformanceInterceptor | Handler-level enter/exit timings when performance: true |
IDebugService | Programmatic logFunctionIO |
ModuleLogger | Wrap plain modules |
Open the UI
http://localhost:<port>/__idebugExports
import {
IDebugModule,
Loggable,
PerformanceInterceptor,
IDebugService,
ModuleLogger,
getStore,
getConfig,
instrumentPrisma,
instrumentDrizzle,
} from '@idebug/nest';instrument* helpers are re-exported from @idebug/db. Express-shaped call-tree demo: sample-db-api on port 3003.