Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: foo-bar → fooBar.
foo-bar
fooBar
Correctly handles Unicode strings.
import camelCase = require('camelcase');camelCase('foo-bar');//=> 'fooBar'camelCase('foo_bar');//=> 'fooBar'camelCase('Foo-Bar');//=> 'fooBar'camelCase('розовый_пушистый_единороги');//=> 'розовыйПушистыйЕдинороги'camelCase('Foo-Bar', {pascalCase: true});//=> 'FooBar'camelCase('--foo.bar', {pascalCase: false});//=> 'fooBar'camelCase('Foo-BAR', {preserveConsecutiveUppercase: true});//=> 'fooBAR'camelCase('fooBAR', {pascalCase: true, preserveConsecutiveUppercase: true}));//=> 'FooBAR'camelCase('foo bar');//=> 'fooBar'console.log(process.argv[3]);//=> '--foo-bar'camelCase(process.argv[3]);//=> 'fooBar'camelCase(['foo', 'bar']);//=> 'fooBar'camelCase(['__foo__', '--bar'], {pascalCase: true});//=> 'FooBar'camelCase(['foo', 'BAR'], {pascalCase: true, preserveConsecutiveUppercase: true})//=> 'FooBAR'camelCase('lorem-ipsum', {locale: 'en-US'});//=> 'loremIpsum'
String to convert to camel case.
Generated using TypeDoc
Convert a dash/dot/underscore/space separated string to camelCase or PascalCase:
foo-bar
→fooBar
.Correctly handles Unicode strings.