Convert object keys to humanized words using
humanize-string
$ npm install humanize-keys
const humanizeKeys = require('humanize-keys');
// Convert an object
humanizeKeys({fooBar: true});
//=> {'Foo bar': true}
// Convert an array of objects
humanizeKeys([{fooBar: true}, {'bar-foo': false}]);
//=> [{'Foo bar': true}, {'Bar foo': false}]
humanizeKeys({'foo-bar': true, nested: {unicorn_rainbow: true}}, {deep: true});
//=> {'Foo bar': true, nested: {'Unicorn rainbow': true}}
const humanizeKeys = require('humanize-keys');
const argv = require('minimist')(process.argv.slice(2));
//=> {_: [], 'foo-bar': true}
humanizeKeys(argv);
//=> {_: [], 'Foo bar': true}
Type: Object
Object[]
Object or array of objects to humanize.
Type: Object
Type: Array<string|RegExp>
Default: []
Exclude keys from being humanized.
Type: boolean
Default: false
Recurse nested objects and objects in arrays.
MIT © Danier R.