source: trip-planner-front/node_modules/camelcase/readme.md@ bdd6491

Last change on this file since bdd6491 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 2.2 KB
Line 
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 or PascalCase: `foo-bar` → `fooBar`
4
5---
6
7<div align="center">
8 <b>
9 <a href="https://tidelift.com/subscription/pkg/npm-camelcase?utm_source=npm-camelcase&utm_medium=referral&utm_campaign=readme">Get professional support for 'camelcase' with a Tidelift subscription</a>
10 </b>
11 <br>
12 <sub>
13 Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
14 </sub>
15</div>
16
17---
18
19## Install
20
21```
22$ npm install camelcase
23```
24
25
26## Usage
27
28```js
29const camelCase = require('camelcase');
30
31camelCase('foo-bar');
32//=> 'fooBar'
33
34camelCase('foo_bar');
35//=> 'fooBar'
36
37camelCase('Foo-Bar');
38//=> 'fooBar'
39
40camelCase('Foo-Bar', {pascalCase: true});
41//=> 'FooBar'
42
43camelCase('--foo.bar', {pascalCase: false});
44//=> 'fooBar'
45
46camelCase('foo bar');
47//=> 'fooBar'
48
49console.log(process.argv[3]);
50//=> '--foo-bar'
51camelCase(process.argv[3]);
52//=> 'fooBar'
53
54camelCase(['foo', 'bar']);
55//=> 'fooBar'
56
57camelCase(['__foo__', '--bar'], {pascalCase: true});
58//=> 'FooBar'
59```
60
61
62## API
63
64### camelCase(input, [options])
65
66#### input
67
68Type: `string` `string[]`
69
70String to convert to camel case.
71
72#### options
73
74Type: `Object`
75
76##### pascalCase
77
78Type: `boolean`<br>
79Default: `false`
80
81Uppercase the first character: `foo-bar` → `FooBar`
82
83
84## Security
85
86To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
87
88
89## Related
90
91- [decamelize](https://github.com/sindresorhus/decamelize) - The inverse of this module
92- [uppercamelcase](https://github.com/SamVerschueren/uppercamelcase) - Like this module, but to PascalCase instead of camelCase
93- [titleize](https://github.com/sindresorhus/titleize) - Capitalize every word in string
94- [humanize-string](https://github.com/sindresorhus/humanize-string) - Convert a camelized/dasherized/underscored string into a humanized one
95
96
97## License
98
99MIT © [Sindre Sorhus](https://sindresorhus.com)
Note: See TracBrowser for help on using the repository browser.