A small but convinient tool to convert your strings to a more code friendly format and back. Useful for dynamic content and helpful for maintaining consistency between your keys, variables and id's.
npm install string-therapy
npm i string-therapy
`
Next up, just add it into your project and use away!
`
//-- slap this package into your project
const st = require("string-therapy");
//-or-//
import st from "string-therapy";
//-Import type for Typescript Use-//
import { StringTherapy } from "string-therapy/lib/StringTherapy"; //- Typescript Use
let newString:StringTherapy = st("Your New String");//-- initiate it with your string
let newString = st("Your New string");
//-- call a method to tame that fella
newString.toCamelCase; //- outputs: yourNewString
/ Other methods defined below /
`The Deets ##
$3
Converts your string to Camel Case format, possibly the most common format in Javascript.
`
const st = require("string-therapy");
let newString = st("Some String");
newString.toCamelCase; //- Outputs: someString
`
$3
Converts your string to Pascal Case format, used often for class naming and templates.
`
const st = require("string-therapy");
let newString = st("Some String");
newString.toPascalCase; //- Outputs: SomeString
`
$3
Converts your string to Kebab Case format, used often in CSS.
`
const st = require("string-therapy");
let newString = st("Some String");
newString.toKebabCase; //- Outputs: some-string
`
$3
Converts your string to Snake Case format, often found for ID's and DB related keys.
`
const st = require("string-therapy");
let newString = st("Some String");
newString.toCamelCase; //- Outputs: some_string
`
$3
Not actually english but you get the gist, it's supposed to convert your already code friendly strings to "english" format with spaces and all.
`
const st = require("string-therapy");
let newString = st("camelCaseString");
newString.toEnglish; //- Outputs: Camel case string
``