text-camel-case

Convert into a text with the separator denoted by the next word capitalized

Usage no npm install needed!

<script type="module">
  import textCamelCase from 'https://cdn.skypack.dev/text-camel-case';
</script>

README

Camel Case

NPM version NPM downloads Bundle size

Convert into a text with the separator denoted by the next word capitalized.

Installation

npm install text-camel-case --save

Usage

import { camelCase } from "text-camel-case";

camelCase("string"); //=> "string"
camelCase("dot.case"); //=> "dotCase"
camelCase("PascalCase"); //=> "pascalCase"
camelCase("camelCase"); //=> "camelCase"
camelCase("version 1.2.3"); //=> "version_1_2_3"

The function also accepts options.

Merge Numbers

If you'd like to remove the behavior prefixing _ before numbers, you can use camelCaseTransformMerge:

import { camelCaseTransformMerge } from "text-camel-case";

camelCase("version 123", { transform: camelCaseTransformMerge }); //=> "version123"

License

MIT