Skip to content

metapic/nestjs-utils

Repository files navigation

nestjs-utils

Utility helpers for Nest.js projects. Comes with opinionated defaults for TypeORM, Swagger and serialisation:

  • Symbols (e.g. DTO property names) always camelCase.
  • API JSON payload property names always snake_case.
  • Database column names always snake_case.

See the example app for a fully wired showcase of all features.

Important: Serialisation uses class-transformer/class-validator (see Nest.js docs). You can use the following helpers for easy setup (see also example/src/app.module.ts)

import { Module } from '@nestjs/common'
import { SERIALIZATION_INTERCEPTOR, VALIDATION_PIPE } from '@metapic/nestjs-utils'

@Module({
  providers: [SERIALIZATION_INTERCEPTOR, VALIDATION_PIPE],
})
export class AppModule {}

Testing

All testing runs through the example app’s e2e suite: example/test.

About

Utilities and helpers for Nest.js + TypeORM.

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •