stringate
Version:
A lightweight JavaScript library for performing common string operations and transformations.
102 lines (70 loc) โข 1.89 kB
Markdown
# ๐ 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