Package Exports
- snakeize
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (snakeize) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
snakeize
recursively transform key strings from camel-case to underscore-style. Derives directly from substack's camelize
example
var snakeize = require('snakeize');
var obj = {
feeFieFoe: 'fum',
beepBoop: [
{ 'abcXyz': 'mno' },
{ 'FooBar': 'baz' },
{ 'CheeseID': 'wensleydale' }
]
};
var res = snakeize(obj);
console.log(JSON.stringify(res, null, 2));output:
{
"fee_fie_foe": "fum",
"beep_boop": [
{
"abc_xyz": "mno"
},
{
"foo_bar": "baz"
},
{
"cheese_id": "wensleydale"
}
]
}methods
var snakeize = require('snakeize')snakeize(obj)
Convert the key strings in obj from camel-case to underscore-stlye recursively.
install
With npm do:
npm install snakeizeTo use in the browser, use browserify or component:
component install nathan7/snakeizelicense
MIT

