Convert your input into lowerCamelcase format, this Node.js module allows you to convert string, array. object into lowerCamelcase.
>=1.0.0 Version of this package requires >=6.0 version of Node.js
To Use This Package For Earlier Versions (<6.0) Of Your Node.js Then Download <1.0.0 Version
Install with the node package manager npm:
- Using npm
$ npm install camelcase-input --save
- Using yarn
$ yarn add camelcase-input
const camelcase = require('camelcase-input').camelcase
console.log(camelcase('Foo-Bar'))
/* OUTPUT */
fooBar
const camelcase = require('camelcase-input').camelcase
console.log(camelcase({'foo-bar': true}))
/* OUTPUT */
{ fooBar: true }
const camelcase = require('camelcase-input').camelcase
console.log(camelcase([{'foo-bar': true}, {'is_that_you': true}]))
/* OUTPUT */
[ { fooBar: true }, { isThatYou: true } ]
const camelcase = require('camelcase-input').camelcase
console.log(camelcase(['Foo-Bar', 'are-you-there']))
/* OUTPUT */
fooBar, areYouThere
const camelcase = require('camelcase-input').camelcase
console.log(camelcase([{'Foo-bar': [{'abc-df__r': true}, {'tghd_dfdf--ee': true}]}, {'bar-foo': { 'Test-te': {'opt-tdt': 'dfdfdf'} }}], { deep: true })))
/* OUTPUT */
[{ fooBar: [{ abcDfR: true }, { tghdDfdfEe: true }] },{ barFoo: { testTe: { optTdt: dfdfdf } } }]
/* SAME APPLIES TO Objects, Array, etc. */
const camelcase = require('camelcase-input').camelcase
console.log(camelcase('1. Information12', { deep: true })))
/* OUTPUT */
information12
/* SAME APPLIES TO Objects, Array, etc. */
const camelcase = require('camelcase-input').camelcase
console.log(camelcase('Information (1 min)', { deep: true })))
/* OUTPUT */
information1Min
/* SAME APPLIES TO Objects, Array, etc. */
const camelcase = require('camelcase-input').camelcase
console.log(camelcase('2018-06-15 06:00:00', { deep: true })))
/* OUTPUT */
2018-06-15 06:00:00
- 1.0.3 remove digit from start of string, remove () from input added
- 1.0.2 nested object conversion issue resolve
- 1.0.1 value assign issue fixed
- 1.0.0 Initial version