UNPKG

stringate

Version:

A lightweight JavaScript library for performing common string operations and transformations.

102 lines (70 loc) โ€ข 1.89 kB
# ๐Ÿ”  stringate A modern and lightweight JavaScript utility library for all your string manipulation needs โ€” from casing, formatting, and trimming to checking palindromes and removing digits or special characters. Simple. Fast. Developer-friendly. --- ## ๐Ÿ“ฆ Installation ```bash npm install stringate ``` --- ## ๐Ÿš€ Quick Start ```js const stringate = require('stringate'); console.log(stringate.capitalize('hello world')); // "Hello World" console.log(stringate.reverse('hello')); // "olleh" console.log(stringate.kebabCase('Hello World')); // "hello-world" console.log(stringate.isPalindrome('Madam')); // true ``` --- ## ๐Ÿ“‹ Available Functions ### ๐Ÿ”ก Basic Formatting - toUpperCase(str) - toLowerCase(str) - capitalize(str) - reverse(str) - concat(...strings) ### ๐Ÿ” Checks & Info - isPalindrome(str) - includes(str, search) - startsWith(str, search) - endsWith(str, search) - stringLength(str) - countVowels(str) - charAt(str, index) ### ๐Ÿช„ Case Conversions - kebabCase(str) - camelCase(str) - snakeCase(str) ### โœ‚๏ธ Trimming & Slicing - trim(str) - trimStart(str) - trimEnd(str) - substring(str, start, end) - split(str, delimiter) ### ๐Ÿงผ Cleanup Utilities - removeSpaces(str) - removeSpecialChars(str) - removeDigits(str) - replaceAll(str, search, replacement) ### ๐Ÿ” Repeating & Padding - repeat(str, times) - padStart(str, targetLength, padChar) - padEnd(str, targetLength, padChar) --- ## ๐Ÿงช Testing You can test the library locally: ```bash node test.js ``` Example test.js: ```js const stringate = require('./index'); console.log(stringate.toUpperCase('test')); // "TEST" console.log(stringate.countVowels('sanjana')); // 3 ``` --- ## ๐Ÿ‘ค Author Made with ๐Ÿ’™ by Sanjana Tankala --- ## ๐Ÿ“„ License ISC License