https://github.com/0xc14m1z/kamelcaser
Convert strings and object keys to camelCase format.
https://github.com/0xc14m1z/kamelcaser
camelcase
Last synced: 4 months ago
JSON representation
Convert strings and object keys to camelCase format.
- Host: GitHub
- URL: https://github.com/0xc14m1z/kamelcaser
- Owner: 0xc14m1z
- License: mit
- Created: 2018-02-13T09:13:26.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-19T09:58:48.000Z (over 8 years ago)
- Last Synced: 2025-10-25T19:54:42.389Z (7 months ago)
- Topics: camelcase
- Language: JavaScript
- Homepage:
- Size: 178 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# kamelcaser
[](https://travis-ci.org/0xc14m1z/kamelcaser) [](https://coveralls.io/github/0xc14m1z/kamelcaser?branch=master) [](https://codeclimate.com/github/0xc14m1z/kamelcaser/maintainability)
Convert strings and object keys to camelCase format.
## how to install
```
$ npm install --save kamelcaser
```
## how to use it
```js
import KamelCaser from "kamelcaser"
// or var KamelCaser = require("kamelcaser")
KamelCaser.string("dashed-string")
// dashedString
KamelCaser.string("snake_string")
// snakeString
KamelCaser.string("PascalString")
// pascalString
KamelCaser.keys({ first_key: 42, SecondKey: 43, "third-key": 44 })
// { firstKey: 42, secondKey: 43, thirdKey: 44 }
// object with deep keys
KamelCaser.keys({ first_key: 42, SecondKey: 43, "third-key": 44, fourthKey: { "fifth_key": 45 } })
// { firstKey: 42, secondKey: 43, thirdKey: 44, fourthKey: { fifthKey: 45 } }
// array of objects
KamelCaser.keys([{ first_key: 42 }, { SecondKey: 43 }, { "third-key": 44 }])
// [{ firstKey: 42 }, { secondKey: 43 }, { thirdKey: 44 }]
```