Skip to content

Latest commit

 

History

History
21 lines (15 loc) · 455 Bytes

README.md

File metadata and controls

21 lines (15 loc) · 455 Bytes

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())