summaryrefslogtreecommitdiff
path: root/node_modules/camelcase/readme.md
blob: 516dc398469e337e644fe21ace5371c46ffd348c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# camelcase [![Build Status](https://travis-ci.org/sindresorhus/camelcase.svg?branch=master)](https://travis-ci.org/sindresorhus/camelcase)

> Convert a dash/dot/underscore/space separated string to camelCase: `foo-bar` → `fooBar`


## Install

```sh
$ npm install --save camelcase
```


## Usage

```js
var camelCase = require('camelcase');

camelCase('foo-bar');
//=> fooBar

camelCase('foo_bar');
//=> fooBar

camelCase('Foo-Bar');
//=> fooBar

camelCase('--foo.bar');
//=> fooBar

camelCase('__foo__bar__');
//=> fooBar

camelCase('foo bar');
//=> fooBar

console.log(process.argv[3]);
//=> --foo-bar
camelCase(process.argv[3]);
//=> fooBar

camelCase('foo', 'bar');
//=> fooBar

camelCase('__foo__', '--bar');
//=> fooBar
```


## Related

See [`decamelize`](https://github.com/sindresorhus/decamelize) for the inverse.


## License

MIT © [Sindre Sorhus](http://sindresorhus.com)