krish-string-utils
v1.0.0
Published
A lightweight collection of common string utility functions
Downloads
133
Readme
krish-string-utils
A lightweight collection of common string utility functions for Node.js.
Installation
npm install krish-string-utils
Usage
const stringUtils = require('krish-string-utils');
stringUtils.capitalize('hello'); stringUtils.reverseString('hello'); stringUtils.isPalindrome('madam'); stringUtils.truncate('hello world', 5);
Functions
- capitalize(str) - capitalizes the first letter
- reverseString(str) - reverses a string
- isPalindrome(str) - checks if a string is a palindrome
- truncate(str, maxLength) - shortens a string and adds "..."
