Skip to content

tommysack/nestjs-result2camelcase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NestJS camelCase API results

This is a NestJS Interceptor to transform the keys of API results (snake-cased or with spaces) to camelCase.

Installation

$ npm i nestjs-result2camelcase

How to use

In your main.ts:

app.useGlobalInterceptors(new ResultToCamelcaseInterceptor());

In your Controller you can use UseInterceptors decorator:

@UseInterceptors(new ResultToCamelcaseInterceptor())