1.3.12 ā¢ Published 2 months ago
@trenskow/caseit v1.3.12
@trenskow/caseit
A small library for changing the case of a string.
Usage
Import using the following example.
const caseit = require('@trenskow/caseit');
ā or
import caseit from '@trenskow/caseit'
Converting
To convert from one case type to another use the following example.
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).
Detecting
To detect the casing of a string do as the following example.
caseit.detect('MyCase'); // returns ['pascal']
caseit.detect('Hello'); // returns ['pascal', 'title', 'http']
Getting the words
You can also get the lowercase variants of all the words in a string by using the following example.
caseit.words('MyCase'); // returns ['my', 'case']
LICENSE
3-Clause BSD (see LICENSE).
1.3.12
2 months ago
1.3.11
4 months ago
1.3.7
9 months ago
1.3.6
10 months ago
1.3.5
10 months ago
1.3.10
7 months ago
1.3.9
7 months ago
1.3.8
8 months ago
1.3.4
1 year ago
1.3.3
2 years ago
1.3.2
2 years ago
1.2.0
2 years ago
1.1.4
2 years ago
1.3.1
2 years ago
1.1.3
2 years ago
1.3.0
2 years ago
1.1.2
2 years ago
1.1.1
3 years ago
1.1.0
3 years ago
1.0.1
4 years ago
1.0.0
4 years ago