Convert object keys to camelCase using
camelcase
$ npm install --save camelcase-keys
const camelcaseKeys = require('camelcase-keys');
camelcaseKeys({'foo-bar': true});
//=> {fooBar: true}
camelcaseKeys({'foo-bar': true, nested: {unicorn_rainbow: true}}, {deep: true});
//=> {fooBar: true, nested: {unicornRainbow: true}}
const camelcaseKeys = require('camelcase-keys');
const argv = require('minimist')(process.argv.slice(2));
//=> {_: [], 'foo-bar': true}
camelcaseKeys(argv);
//=> {_: [], fooBar: true}
Type: Object
Object to camelCase.
Type: Object
Type: string[]
RegExp[]
Default: []
Exclude keys from being camelCased.
Type: boolean
Default: false
Recurse nested objects and objects in arrays.
MIT © Sindre Sorhus