camelcase

WebJar for camelcase

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

camelcase
Last Version

Last Version

6.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

camelcase
WebJar for camelcase
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/sindresorhus/camelcase

Download camelcase

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/camelcase/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>camelcase</artifactId>
    <version>6.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/camelcase/
implementation 'org.webjars.npm:camelcase:6.2.0'
// https://jarcasting.com/artifacts/org.webjars.npm/camelcase/
implementation ("org.webjars.npm:camelcase:6.2.0")
'org.webjars.npm:camelcase:jar:6.2.0'
<dependency org="org.webjars.npm" name="camelcase" rev="6.2.0">
  <artifact name="camelcase" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='camelcase', version='6.2.0')
)
libraryDependencies += "org.webjars.npm" % "camelcase" % "6.2.0"
[org.webjars.npm/camelcase "6.2.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

camelcase Build Status

Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: foo-barfooBar

Correctly handles Unicode strings.

Install

$ npm install camelcase

If you need to support Firefox, stay on version 5 as version 6 uses regex features not available in Firefox.

Usage

const 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'

API

camelCase(input, options?)

input

Type: string | string[]

String to convert to camel case.

options

Type: object

pascalCase

Type: boolean
Default: false

Uppercase the first character: foo-barFooBar

preserveConsecutiveUppercase

Type: boolean
Default: false

Preserve the consecutive uppercase characters: foo-BARFooBAR.

locale

Type: string | string[]
Default: The host environment’s current locale.

The locale parameter indicates the locale to be used to convert to upper/lower case according to any locale-specific case mappings. If multiple locales are given in an array, the best available locale is used.

const camelCase = require('camelcase');

camelCase('lorem-ipsum', {locale: 'en-US'});
//=> 'loremIpsum'

camelCase('lorem-ipsum', {locale: 'tr-TR'});
//=> 'loremİpsum'

camelCase('lorem-ipsum', {locale: ['en-US', 'en-GB']});
//=> 'loremIpsum'

camelCase('lorem-ipsum', {locale: ['tr', 'TR', 'tr-TR']});
//=> 'loremİpsum'

camelcase for enterprise

Available as part of the Tidelift Subscription.

The maintainers of camelcase and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.

Related

Versions

Version
6.2.0
6.0.0
5.3.1
5.3.0
5.2.0
5.0.0
4.1.0
4.0.0
3.0.0
2.1.1
2.0.1
1.2.1
1.0.2