recursively transform key strings to camel-case
JavaScript
Switch branches/tags
Latest commit 20a1485 Jul 7, 2014 @substack 1.0.0
Permalink
Failed to load latest commit information.
example docs Mar 23, 2013
test add support for dates and regex Jul 7, 2014
.travis.yml using travis Mar 23, 2013
LICENSE package.json etc Mar 23, 2013
index.js add support for dates and regex Jul 7, 2014
package.json 1.0.0 Jul 7, 2014
readme.markdown badges Mar 23, 2013

readme.markdown

camelize

recursively transform key strings to camel-case

build status

browser support

example

var camelize = require('camelize');
var obj = {
    fee_fie_foe: 'fum',
    beep_boop: [
        { 'abc.xyz': 'mno' },
        { 'foo-bar': 'baz' }
    ]
};
var res = camelize(obj);
console.log(JSON.stringify(res, null, 2));

output:

{
  "feeFieFoe": "fum",
  "beepBoop": [
    {
      "abcXyz": "mno"
    },
    {
      "fooBar": "baz"
    }
  ]
}

methods

var camelize = require('camelize')

camelize(obj)

Convert the key strings in obj to camel-case recursively.

install

With npm do:

npm install camelize

To use in the browser, use browserify.

license

MIT