Simple functions that recursively change the case of keys in plain objects. Practical when exposing camel-case names in an API with a snake-cased database backend. This module builds on the excellent Case to perform the actual case conversion. So any conversion supported by Case is supported by recase-keys.
$ npm install recase-keys
var recase = require('recase-keys')
console.log(
recase.toCamel({
hello_world: ['hello_world','FOO_BAR'],
foo_bar: [{tic_tac_toe: 9}]
})
)
// Outputs
// {
// helloWorld: ['hello_world', 'FOO_BAR'],
// fooBar: [{ticTacToe:9}]
// }