
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
string-toolkit
Advanced tools
npm i string-toolkit
// 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!'
toChunks(string, number)
const output = stringTools.toChunks('hey there!', 3);
console.log(output); // [ 'hey', ' th', 'ere', '!' ]
scramble(string)
const output = stringTools.scramble('hey there!');
console.log(output); // 'rte! ehyhe'
mock(string)
const output = stringTools.mock('hey there!');
console.log(output); // 'HeY ThErE!'
emojify(string)
const output = stringTools.emojify('hey there!');
console.log(output);
// '🇭🇪🇾 🇹🇭🇪🇷🇪❗'
hasCustomEmoji(string)
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); // '+++++@~~~~'
toAbbreviation(string)
const output = stringTools.toAbbreviation('hey there!');
console.log(output); // 'ht'
fakeToken()
const output = stringTools.fakeToken();
console.log(output);
// 'NDI0NTYyNzY1NTMzNzQ0MjY3MA==.Cz0j0.Zf6Tfo17wN27N8tnkoG164Q9'
decancer(string)
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'
parseOptions(string[])
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'
}
*/
FAQs
A package containing tools to manipulate a string.
The npm package string-toolkit receives a total of 1 weekly downloads. As such, string-toolkit popularity was classified as not popular.
We found that string-toolkit demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.