A lightweight, zero-dependency library for common string manipulations.
npm install tiny-string-utilsimport { capitalize, slugify, camelCase, truncate } from 'tiny-string-utils';
capitalize('hello'); // 'Hello'
slugify('Hello World!'); // 'hello-world'
camelCase('foo-bar-baz'); // 'fooBarBaz'
truncate('Long text...', 8); // 'Long...'capitalize(str)— Capitalize the first letterslugify(str)— Convert to URL-friendly slugtruncate(str, length, suffix?)— Truncate with suffixcamelCase(str)— Convert to camelCasekebabCase(str)— Convert to kebab-casesnakeCase(str)— Convert to snake_casereverse(str)— Reverse a stringcountWords(str)— Count wordsstripWhitespace(str)— Remove all whitespaceisPalindrome(str)— Check if palindromepadCenter(str, length, char?)— Center-pad a stringrepeat(str, count, separator?)— Repeat a string