Small library for converting between different casing.
npm install @trenskow/caseit@trenskow/caseit
----
A small library for changing the case of a string.
Import using the following example.
```javascript``
const caseit = require('@trenskow/caseit');
ā or
``javascript``
import caseit from '@trenskow/caseit'
To convert from one case type to another use the following example.
`javascript`
const myCamelCase = caseit('my_camel_case', 'camel'); // return 'myCamelCase';
You can convert from any format to any other format. Supported formats are.
* camel - camelCasepascal
* - PascalCasesnake
* - snake_casedomain
* - domain.casekebab
* - kebab-casetitle
* - Title Casehttp
* - Http-Case
> Default format (if omitted) is camel (because it is the Javascript default).
To detect the casing of a string do as the following example.
``javascript``
caseit.detect('MyCase'); // returns ['pascal']
caseit.detect('Hello'); // returns ['pascal', 'title', 'http']
You can also get the lowercase variants of all the words in a string by using the following example.
``javascript```
caseit.words('MyCase'); // returns ['my', 'case']
3-Clause BSD (see LICENSE).