Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
frostney committed Nov 30, 2015
1 parent 8f1c222 commit 70c8caf
Showing 1 changed file with 46 additions and 1 deletion.
47 changes: 46 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,52 @@
# change-case-object

[![Build Status](https://travis-ci.org/BinaryThumb/change-case-object.svg?branch=master)](https://travis-ci.org/BinaryThumb/change-case-object)

[![Coverage Status](https://coveralls.io/repos/BinaryThumb/change-case-object/badge.svg?branch=master&service=github)](https://coveralls.io/github/BinaryThumb/change-case-object?branch=master)

Changes the case of all object's keys

## Installation

`npm install change-case-object`
Currently, only CommonJS environments are supported. (This means Node.js and browser with `browserify` or `webpack`)

## Example

```javascript
var changeCaseObject = require('change-case-object');

var myObject = {
hello_world: 'hi',
};

var newObject = changeCaseObject.camelCase(myObject);
// {helloWorld: 'hi'}
```

## Methods
All methods are available under the `changeCaseObject` object after the module has been required.

### .camelCase
Conerts all object keys into camel case.
`hello_world -> helloWorld`

### .snakeCase
Conerts all object keys into snake case.
`helloWorld -> hello_world`

### .paramCase
Conerts all object keys into param case.
`helloWorld -> hello-world`

Shorthand methods are also available:
```
.camelCase -> .camel
.snakeCase -> .snake
.paramCase -> .param
```

## Code Guideline
AirBnB ES5

## License
MIT

0 comments on commit 70c8caf

Please sign in to comment.