1.0.8 • Published 3 years ago
@jeash/case v1.0.8
@jeash/case
A lightweight package for converting string cases.
Installation
Install @jeash/case using npm:
npm install @jeash/caseUsage
Here is an example of how to use @jeash/case:
import { titleCase, kebabCase } from '@jeash/case';
const myTitleCaseString = titleCase('hello world');
const myKebabCaseString = kebabCase('hello world');Alternatively, you can import the methods individually:
import titleCase from '@jeash/case/titleCase';
import kebabCase from '@jeash/case/kebabCase';
const myTitleCaseString = titleCase('hello world');
const myKebabCaseString = kebabCase('hello world');API
@jeash/case exports the following methods:
alternatingCase
alternatingCase('Hello World') // => HeLlO WoRlDalternatingInverseCase
alternatingInverseCase('Hello World') // => hElLo wOrLdinverseCase
inverseCase('Hello World') // => hELLO wORLDjejeCase
jejeCase('Hello World') // => HElLoH WOrlDkebabCase
kebabCase('Hello World') // => hello-worldsentenceCase
sentenceCase('Hello World') // => Hello worldsnakeCase
snakeCase('Hello World') // => hello_worldtitleCase
titleCase('Hello World') // => Hello WorldwideCase
wideCase('Hello World') // => H e l l o W o r l dwideLowerCase
wideLowerCase('Hello World') // => h e l l o w o r l dwideUpperCase
wideUpperCase('Hello World') // => H E L L O W O R L DContributing
Contributions to @jeash/case are welcome. If you have any bug fixes, improvements or feature requests, please submit a pull request on GitHub.