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

camelize Version Badge

github actions coverage License Downloads

npm badge

recursively transform key strings to camel-case

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.1                                ...           latest (2 years ago)

7 Versions

  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           10 years ago
  • 0.2.0                                ...           10 years ago
  • 0.1.2                                ...           11 years ago
  • 0.1.1                                ...           11 years ago
  • 0.1.0                                ...           11 years ago
  • 0.0.0                                ...           12 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 2
Last Month 0
Dependencies (0)
None
Dev Dependencies (2)
Dependents (3)

Copyright 2013 - present © cnpmjs.org | Home |