A set of simple extensions for the JavaScript String class.
In terminal/console type:
npm install simple-string-extensions
Somewhere early in code use:
import 'simple-string-extensions';
Finally in code:
const someCapitalizedStr = someStr.capitalize();
const someCamelCaseStr = someStr.toCamelCase();
-
capitalize
: A method to capitalize strings. -
toCamelCase
: A method to transform strings into camel case. -
toConstantCase
: A method to transform strings into constant case. -
toDashCase
: A method to transform strings into dash case. -
toPascalCase
: A method to transform strings into pascal case. -
toSnakeCase
: A method to transform strings into snake case. -
toSpaceCase
: A method to transform strings into space case.
Tests can be run with:
npm run test