@rocketstation/change-case
v2.0.0
Published
it provides helpers to convert strings to kebab, snake lower & upper, camel lower & upper cases
Downloads
6
Readme
Change Case
Change Case is based on just. It provides helpers to convert strings to kebab, snake lower & upper, camel lower & upper cases
Installation
npm i @rocketstation/change-case
Usage
import * as changeCase from '@rocketstation/change-case'
console.log(changeCase.c('foo bar', ['foo', 'bar'], 'foo', 'bar')) // fooBarFooBarFooBar
console.log(changeCase.p('foo bar', ['foo', 'bar'], 'foo', 'bar')) // FooBarFooBarFooBar
console.log(changeCase.sl('foo bar', ['foo', 'bar'], 'foo', 'bar')) // foo_bar_foo_bar_foo_bar
console.log(changeCase.su('foo bar', ['foo', 'bar'], 'foo', 'bar')) // FOO_BAR_FOO_BAR_FOO_BAR
console.log(changeCase.k('foo bar', ['foo', 'bar'], 'foo', 'bar')) // foo-bar-foo-bar-foo-bar
Motivation
We were tired of writing this code again and again
License
Change Case is licensed under the MIT License
Created by RocketStation