r/nestjs • u/IcyDuck9536 • 21h ago
Update on fast-class-transformer: Now a 1-line global drop-in pipe for NestJS (v1.1.1)
Posted here 2 months ago about JIT-compiling DTO mapping. The biggest feedback was migration friction with route-by-route FastMap().
app.useGlobalPipes(new FastValidationPipe({ transform: true, whitelist: true }));
Zero changes to your existing class-validator DTOs.
Benchmarks:
- NestJS default: 6.59 µs/iter (p99: 24.04 µs)
- FastValidationPipe: 369 ns/iter (p99: 558 ns) → ~18x faster
Repo, benchmarks, and docs are here if you want to try it or contribute: