Just a package containing tools to manipulate a string.
// Creating a new instance.
const stringTools = new ( require ( 'string-toolkit' ) ) ( ) ;
// Can also be used without a new instance.
const stringTools = require ( 'string-toolkit' ) ;
const stringTools = require ( 'string-toolkit' ) ;
console . log ( stringTools . toProperCase ( 'hey there!' ) ) ;
toProperCase(string[, boolean])
const output = stringTools . toProperCase ( 'hey there!' , true ) ;
console . log ( output ) ; // 'Hey There!'
const output = stringTools . toChunks ( 'hey there!' , 3 ) ;
console . log ( output ) ; // [ 'hey', ' th', 'ere', '!' ]
const output = stringTools . scramble ( 'hey there!' ) ;
console . log ( output ) ; // 'rte! ehyhe'
const output = stringTools . mock ( 'hey there!' ) ;
console . log ( output ) ; // 'HeY ThErE!'
const output = stringTools . emojify ( 'hey there!' ) ;
console . log ( output ) ;
// '🇭🇪🇾 🇹🇭🇪🇷🇪❗'
const output = stringTools . hasCustomEmoji ( 'hey there!' ) ;
console . log ( output ) ; // false
createProgressBar(number, number[, object])
const output = stringTools . createProgressBar ( 57 , 100 , {
elapsedChar : '+' ,
progressChar : '@' ,
emptyChar : '~' ,
barLength : 10
} ) ;
console . log ( output ) ; // '+++++@~~~~'
const output = stringTools . toAbbreviation ( 'hey there!' ) ;
console . log ( output ) ; // 'ht'
const output = stringTools . fakeToken ( ) ;
console . log ( output ) ;
// 'NDI0NTYyNzY1NTMzNzQ0MjY3MA==.Cz0j0.Zf6Tfo17wN27N8tnkoG164Q9'
const output = stringTools . decancer ( '𝓱𝓮𝔂 𝓽𝓱𝓮𝓻𝓮!' ) ;
console . log ( output ) ; // 'hey there!'
shorten(string, number[, string])
const output = stringTools . shorten ( 'bruh moment' , 4 , 'end' ) ;
console . log ( output ) ; // 'bruhend'
const str = 'bruh --moment what bro --search --big bruh moment' ;
const output = stringTools . parseOptions ( str . split ( ' ' ) ) ;
console . log ( output ) ;
/*
{
options: {
moment: 'what bro',
big: 'bruh moment'
},
flags: [ 'search' ],
contentNoOptions: 'bruh',
contentNoFlags: 'bruh what bro bruh moment'
}
*/