@nd-460/string-utils
v1.5.1
Published
Simple string helper function
Readme
string-utils
✨ Simple string helper functions for everyday use.
📦 Installation
npm install string-utils📖 Interactive Reference
| Function | Example Input | Example Output |
| ------------------- | --------------------------------- | ---------------------------------------- |
| capitalizeWords | "hello world" | "Hello World" |
| toLowerCaseWords | "HELLO" | "hello" |
| reverseString | "hello" | "olleh" |
| isPalindrome | "Ono" | true |
| toTitleCase | "hello world" | "Hello World" |
| toCamelCase | "hello_world" | "helloWorld" |
| toSnakeCase | "HelloWorld" | "hello_world" |
| toKebabCase | "Hello World" | "hello-world" |
| toPascalCase | "hello world" | "HelloWorld" |
| truncate | "Hello world, this is cool", 10 | "Hello wor..." |
| removeExtraSpaces | " hello world " | "hello world" |
| repeatString | "abc", 3 | "abcabcabc" |
| isAlpha | "hello123" | false |
| isNumeric | "123" | true |
| isAlphaNumeric | "abc123" | true |
| isEmail | "[email protected]" | true |
| isUrl | "https://openai.com" | true |
| toBase64 | "hello" | "aGVsbG8=" |
| fromBase64 | "aGVsbG8=" | "hello" |
| slugify | "Hello World!!" | "hello-world" |
| escapeHtml | "<script>" | "<script>" |
| toCurrencyWords | 1234 | "One Thousand Two Hundred Thirty Four" |
| maskAadhaar | "1234 5678 9123" | "XXXX XXXX 9123" |
| maskPhone | "+91-9876543210" | "+91-XXXXXX3210" |
| shuffle | "neel" | "elen" (random order) |
| randomString | 8 | "aZkL90xQ" (random string) |
| stylize | "hello", "✨" | "✨h✨e✨l✨l✨o✨" |
🛠 Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
