camel-case

Transform into a string with the separator denoted by the next word capitalized

MIT 21 个版本
安装
npm install camel-case
yarn add camel-case
pnpm add camel-case
bun add camel-case
README

Camel Case

Transform into a string with the separator denoted by the next word capitalized.

Installation

npm install camel-case --save

Usage

import { camelCase } from "camel-case";

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

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 "camel-case";

camelCase("version 12", { transform: camelCaseTransformMerge }); //=> "version12"

License

MIT

版本列表
5.0.0 2023-09-30
4.1.2 2020-12-02
4.1.1 2019-12-19
4.1.0 2019-12-06
4.0.1 2019-12-03
4.0.0 2019-12-01
3.0.0 2016-06-12
2.1.0 2016-06-12
2.0.0 2016-06-11
1.2.2 2015-12-16
1.2.1 2015-12-16
1.2.0 2015-10-21
1.1.2 2015-05-11
1.1.1 2015-01-12
1.1.0 2015-01-12
1.0.2 2014-08-19
1.0.1 2014-08-17
1.0.0 2014-08-17
0.1.0 2014-04-09
0.0.2 2014-03-25
0.0.1 2014-03-24