A simple TypeScript package for string manipulation.
npm install @ashisj/string-utils
import { capitalizeWords, reverseString, countWords } from '@ashisj/string-utils';
// Capitalize words
console.log(capitalizeWords('hello world')); // Output: "Hello World"
// Reverse string
console.log(reverseString('hello')); // Output: "olleh"
// Count words
console.log(countWords('hello world')); // Output: 2
capitalizeWords(str: string): string
Capitalizes the first letter of each word in a string
reverseString(str: string): string
Reverses all characters in a string.
countWords(str: string): number
Counts the number of words in a string.