text-camel-case
v1.0.2
Published
Convert into a text with the separator denoted by the next word capitalized
Downloads
10,400
Maintainers
Readme
Camel Case
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