Skip to content

Commit 27640d6

Browse files
committed
Readme first to define what the package will do
0 parents  commit 27640d6

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

README.md

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# JSON camelKeys
2+
3+
Convert object keys to camelCase using [`camelcase`](https://github.com/fahdi/camel-keys)
4+
5+
6+
## Install
7+
8+
```bash
9+
npm install camel-keys --save
10+
```
11+
12+
```bash
13+
yarn add camel-keys
14+
```
15+
16+
## Usage
17+
18+
```js
19+
const camelKeys = require('camel-keys');
20+
21+
camelKeys({'foo-bar': true});
22+
//=> {fooBar: true}
23+
24+
camelKeys({'foo-bar': true, nested: {unicorn_rainbow: true}}, false);
25+
//=> {fooBar: true, nested: {unicorn_rainbow: true}}
26+
27+
camelKeys({'foo-bar': true, nested: {unicorn_rainbow: true}}, true);
28+
//=> {fooBar: true, nested: {unicornRainbow: true}}
29+
```
30+
31+
32+
## API
33+
34+
### camelKeys(input, deep)
35+
36+
##### input
37+
38+
Type: `Object`
39+
40+
Object to camelCase.
41+
42+
##### deep
43+
44+
Type: `boolean`<br>
45+
Default: `false`
46+
47+
Recurse nested objects and objects in arrays.
48+
49+
## License
50+
51+
MIT © [Fahad Murtaza](http://www.fahdmurtaza.com)

0 commit comments

Comments
 (0)