@ericanaglik/kevin-string v1.0.3
Kevin String
Getting Started
Run the following command in your project folder:
npm install @ericanaglik/kevin-string --saveThen add this to your index.js file
require('@ericanaglik/src/kevin-string')Capitalization
capitalize()
This method capitalizes the first letter of an entire string
'hello world!'.capitalize() → "Hello world!"
allCaps()
This method capitalizes ALL letters in a string
'hello world!'.allCaps() → "HELLO WORLD!"
capitalizeWords()
This method capitalizes the first letter of every word in a string
'hello world!'.capitalizeWords() → "Hello World!"
Special Casing
kabobCase()
This method transforms a string into lower case and separates words with hyphens
'Hello World'.kabobCase() → "hello-world"
snakeCase()
This method transforms a string into lower case and separates words with an underscore
'Hello World'.snakeCase() → "hello_world"
camelCase()
This method removes spaces from a string and capitalizes the first letter of each word following the first word
'Hello World'.camelCase() → "helloWorld"
Spacing
removeExtraSpaces()
This method removes excess spaces around words (leaves single space)
' Hello World '.removeAllSpaces() → "Hello World"