camelize
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/camelize package

1.0.1 • Public • Published

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

Dependencies (0)

    Dev Dependencies (8)

    Package Sidebar

    Install

    npm i camelize

    Weekly Downloads

    5,657,349

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    12.5 kB

    Total Files

    9

    Last publish

    Collaborators

    • ljharb