string-things
Simple string functions in one tiny bundle.
I found a work project using a 30kb library to kebab case a string which was of course too large, so I have tried to provide this function and more in a small package for my web projects.
Usage
npm install string-things
or
yarn add string-things
Functions provided
camelCase
; ;// => "fredBillAndTed" ;// => "someMuddledUpText"
kebabCase
; ;// => "string-things" ;// => "string-things"
capitaliseFirstLetter
; ;// => "Charlie"
unescape
; ;// => "<div>"
titleCase
; ;// => "A Property Name Which Needs To Be Displayed As A Title"
truncate
truncate(stringValue, options)
; ;// => "Once upon a time there..." ;// => "Once upon a time..."
Actively maintained
Every time I need a string function, I will be adding it to this library.