• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

index.jsD24-Sep-2023550 2823

licenseD24-Sep-20231.1 KiB2217

package.jsonD24-Sep-2023703 3938

readme.mdD24-Sep-2023889 5734

readme.md

1# camelcase [![Build Status](https://travis-ci.org/sindresorhus/camelcase.svg?branch=master)](https://travis-ci.org/sindresorhus/camelcase)
2
3> Convert a dash/dot/underscore/space separated string to camelCase: `foo-bar` → `fooBar`
4
5
6## Install
7
8```sh
9$ npm install --save camelcase
10```
11
12
13## Usage
14
15```js
16var camelCase = require('camelcase');
17
18camelCase('foo-bar');
19//=> fooBar
20
21camelCase('foo_bar');
22//=> fooBar
23
24camelCase('Foo-Bar');
25//=> fooBar
26
27camelCase('--foo.bar');
28//=> fooBar
29
30camelCase('__foo__bar__');
31//=> fooBar
32
33camelCase('foo bar');
34//=> fooBar
35
36console.log(process.argv[3]);
37//=> --foo-bar
38camelCase(process.argv[3]);
39//=> fooBar
40
41camelCase('foo', 'bar');
42//=> fooBar
43
44camelCase('__foo__', '--bar');
45//=> fooBar
46```
47
48
49## Related
50
51See [`decamelize`](https://github.com/sindresorhus/decamelize) for the inverse.
52
53
54## License
55
56MIT © [Sindre Sorhus](http://sindresorhus.com)
57