1.4.9 • Published 5 months ago

@trenskow/caseit v1.4.9

Weekly downloads
-
License
BSD-2-Clause
Repository
github
Last release
5 months ago

@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 - camelCase
  • pascal - PascalCase
  • snake - snake_case
  • domain - domain.case
  • kebab - kebab-case
  • title - Title Case
  • http - 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.4.9

5 months ago

1.4.8

6 months ago

1.4.7

6 months ago

1.4.6

7 months ago

1.4.5

7 months ago

1.4.4

9 months ago

1.4.3

9 months ago

1.4.2

9 months ago

1.4.1

9 months ago

1.4.0

9 months ago

1.3.15

9 months ago

1.3.14

10 months ago

1.3.13

11 months ago

1.3.12

1 year ago

1.3.11

1 year ago

1.3.7

2 years ago

1.3.6

2 years ago

1.3.5

2 years ago

1.3.10

2 years ago

1.3.9

2 years ago

1.3.8

2 years ago

1.3.4

2 years ago

1.3.3

3 years ago

1.3.2

3 years ago

1.2.0

3 years ago

1.1.4

3 years ago

1.3.1

3 years ago

1.1.3

3 years ago

1.3.0

3 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.1

5 years ago

1.0.0

6 years ago