Converts naming cases from one to another. For Example: camelCase to snake_case.
npm install @xdream77/case-converter
!Test
!Node.js Version
- Converts cases from one to another.
- Perfect to clean and unify your code.
- Zero Dependency
Run example.js for live action.
Javascript
npm i @xdream77/case-converter
`$3
- toCamel
- toKebab
- toPascal
- toSnake
$3
`Javascript
const { toSnake, toCamel } = require('@xdream77/case-converter');const str = 'This_is-myCamel';
console.log(toSnake(str)); // this_is_my_camel
console.log(toCamel(str)); // thisIsMyCamel
`$3
`Javascript
const { objectKeys, toCamel } = require('@xdream77/case-converter');const obj = {
MyMulti : 'hello',
'This_is-myCamel': 'isWeird',
with_underscore : 'isPossible',
andAlsoCamels : 'are supported'
};
console.log(objectKeys(obj, toCamel));
/**
{
myMulti: 'hello',
thisIsMyCamel: 'isWeird',
withUnderscore: 'isPossible',
andAlsoCamels: 'are supported'
}
*/
``