camelize
recursively transform key strings to camel-case
Last updated 6 years ago by substack .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install camelize 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.0.0                                ...           latest (6 years ago)

6 Versions

  • 1.0.0                                ...           6 years ago
  • 0.2.0                                ...           6 years ago
  • 0.1.2                                ...           7 years ago
  • 0.1.1                                ...           7 years ago
  • 0.1.0                                ...           7 years ago
  • 0.0.0                                ...           8 years ago
Maintainers (1)
Downloads
Today 75
This Week 6,333
This Month 78,786
Last Day 3,072
Last Week 20,663
Last Month 77,790
Dependencies (0)
None
Dev Dependencies (1)
Dependents (190)

Copyright 2014 - 2016 © taobao.org |