https://github.com/monojack/ccqp
camel case query params express middleware
https://github.com/monojack/ccqp
camelcase express-middleware params query
Last synced: 2 months ago
JSON representation
camel case query params express middleware
- Host: GitHub
- URL: https://github.com/monojack/ccqp
- Owner: monojack
- License: mit
- Created: 2019-01-10T10:26:37.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-10T10:54:39.000Z (over 6 years ago)
- Last Synced: 2025-03-10T17:13:16.540Z (2 months ago)
- Topics: camelcase, express-middleware, params, query
- Language: JavaScript
- Size: 80.1 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# **ccqp**
[](https://travis-ci.org/monojack/ccqp)
[](https://www.npmjs.com/package/ccqp)
[](https://www.npmjs.com/package/ccqp)
[](https://bundlephobia.com/result?p=ccqp@latest)[express](https://expressjs.com/) middleware to recursively transform query params keys to camel-case.
**TL;DR**
```sh
npm install ccqp
``````js
const express = require('express')
const ccqp = require('ccqp')const app = express()
app.use(ccqp)// ...
```
A request with the following querystring:
```js
const qs = `
?first_name=John
&LastName=Doe
&date-of_-birth=01.01.1985
&hair.color=brown
&contact[email][email protected]
&contact[phone_number]=754-3010
`
```will have the following `req.query`:
```js
{
firstName: 'John',
lastName: 'Doe',
dateOfBirth: '01.01.1985',
hairColor: 'brown',
contact: {
email: '[email protected]',
phoneNumber: '754-3010',
},
}
```