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