README.md 728 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# isCamelCase

This small package can check if a given string or a file is in camelCase style.

# install

#### Yarn

```c
yarn add iscamelcase
```

#### NPM

15
```c
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
npm install iscamelcase
```

# example

At first we have to require the package:

```js
const isCamelCase = require("iscamelcase");
```

There are two options to compare a given string. Both return a boolean.

##### string is a normal value

In this case we can use the checkString function:

```js
console.log(isCamelCase.checkString("foo"));
```

##### string is a file

In this case we should use the checkFile function:

```js
Marcel Dominic Bandowski's avatar
Marcel Dominic Bandowski committed
42
console.log(isCamelCase.checkFile("foo.bar"));
43
44
```

Marcel Dominic Bandowski's avatar
Marcel Dominic Bandowski committed
45
46
This function will also return false if the string is missing a file extension.