/express-camelcase-response-keys

Express middleware for converting response json to camelCase

Primary LanguageJavaScript

Express camelCase response keys

Tiny Express middleware to convert JSON-response data into camelcase notation.

Response before middleware:

{ "some_field": "blabla" }

Response after middleware:

{ "someField": "blablabla" }

Installation

npm install express-camelcase-response-keys

Usage

See camelcase-keys for configuration options.

app.use(require('express-camelcase-response-keys')(/* options here */));

Example

const camelcaseMiddleware = require('express-camelcase-response-keys');

app.use(camelcaseMiddleware({
    deep: true
}));