1.1.6 • Published 5 years ago
textstuff v1.1.6
Installation:
npm install textstuff
Usage:
Capitalize the entirety of a string:
const TextStuff = require('textstuff');
const textstuff = new TextStuff();
let string = 'this is a lowercase string';
string = textstuff.capitalize(string);
console.log(string) // expected output: 'THIS IS A LOWERCASE STRING'
Lowercase the entirety of a string:
const TextStuff = require('textstuff');
const textstuff = new TextStuff();
let string = 'THIS IS AN UPPERCASE STRING';
string = textstuff.lowercase(string);
console.log(string); // expected output: 'this is an uppercase string'
Capitalize/Lowercase random letters of a string:
const TextStuff = require('textstuff');
const textstuff = new TextStuff();
let string = 'this is a string';
string = textstuff.mockText(string);
console.log(string); // expected output: 'tHiS iS a StRiNg', or something similar
Capitalize the first letter of a string:
const TextStuff = require('textstuff');
const textstuff = new TextStuff();
let string = 'this is a string';
string = textstuff.capitalizeFirst(string);
console.log(string); // expected output: 'This is a string'
Randomize a string:
const TextStuff = require('textstuff');
const textstuff = new TextStuff();
let string = 'this is a string';
string = textstuff.mixLetters(string);
console.log(string); // expected output: 'n itiisrs hat gs', or something similar