SkillAgentSearch skills...

GetStringUtils

πŸš€ String Utilities is a lightweight package for common string operations. πŸ”  Easily extract initials from names or phrases. ⚑ Designed for both JavaScript and TypeScript projects. πŸ“¦ Simple installation and usage with npm or yarn. πŸ› οΈ More string functions coming soonβ€”stay tuned! πŸŽ‰

Install / Use

/learn @NAVIN0507/GetStringUtils
About this skill

Quality Score

0/100

Category

Design

Supported Platforms

Universal

README

πŸ“œ String Utilities - @navin0507/string-utilsmns

A lightweight and powerful string utility package for JavaScript & TypeScript. It provides essential string manipulation functions for web development and general programming.

πŸš€ Features

βœ” Extract initials from a string
βœ” Convert strings to different cases (kebab-case, PascalCase, snake_case)
βœ” Generate random strings and slugs
βœ” Sanitize HTML & validate URLs
βœ” Encode/decode URLs & handle query strings
βœ” Format and transform text easily


πŸ“¦ Installation

Install via npm:

npm install @navin0507/string-utilsmns

or via yarn:

yarn add @navin0507/string-utilsmns

πŸš€ Usage

Import functions in your JavaScript or TypeScript project:

const { getInitials, toKebaCase, isValidEmail } = require('@navin0507/string-utilsmns');

// Extract initials
console.log(getInitials("John Doe", 2)); // Output: JD

// Convert to kebab-case
console.log(toKebaCase("Hello World")); // Output: hello-world

// Validate Email
console.log(isValidEmail("test@example.com")); // Output: true

πŸ“š Functions & Use Cases

| Function | Description | Example Usage | |-------------|----------------|--------------------| | getInitials(str, length) | Extracts initials from a name | getInitials("John Doe", 2) β†’ "JD" | | getRandomString(length) | Generates a random alphanumeric string | getRandomString(8) β†’ "aB9xT3pL" | | toKebaCase(str) | Converts string to kebab-case | toKebaCase("Hello World") β†’ "hello-world" | | toSnakeCase(str) | Converts string to snake_case | toSnakeCase("Hello World") β†’ "hello_world" | | toPascalCase(str) | Converts string to PascalCase | toPascalCase("hello world") β†’ "HelloWorld" | | truncateString(str, length) | Truncates string with ... | truncateString("Hello World", 5) β†’ "Hello..." | | removeWhitespace(str) | Removes all whitespace from string | removeWhitespace("Hello World") β†’ "HelloWorld" | | toTitleCase(str) | Converts to Title Case | toTitleCase("hello world") β†’ "Hello World" | | toSlug(str) | Converts string to a slug | toSlug("Hello World!") β†’ "hello-world" | | maskString(str, visibleCount, maskChar) | Masks a string (e.g., credit card, email) | maskString("12345678", 4, "*") β†’ "****5678" | | handleURL(str, type) | Encodes or decodes a URL | handleURL("Hello World!", "encode") β†’ "Hello%20World%21" | | sanitizeHTML(str) | Escapes HTML to prevent XSS attacks | sanitizeHTML('<script>alert("XSS")</script>') β†’ "&lt;script&gt;alert(&quot;XSS&quot;)&lt;/script&gt;" | | getDomain(url) | Extracts domain from a URL | getDomain("https://example.com/page") β†’ "example.com" | | isValidEmail(email) | Validates email format | isValidEmail("test@example.com") β†’ true | | parseQueryString(query) | Converts query string to an object | parseQueryString("name=John&age=25") β†’ { name: "John", age: "25" } | | toQueryString(params) | Converts an object to a query string | toQueryString({ name: "John", age: 25 }) β†’ "name=John&age=25" | | stripHTML(str) | Removes all HTML tags | stripHTML("<p>Hello</p>") β†’ "Hello" | | isValidURL(str) | Checks if a string is a valid URL | isValidURL("https://google.com") β†’ true | | normalizeURL(url) | Ensures URL has http:// or https:// | normalizeURL("google.com") β†’ "https://google.com" | | obfuscateEmail(email) | Hides email partially for privacy | obfuscateEmail("test@example.com") β†’ "****@example.com" | | getRandomHexColor() | Generates a random hex color | getRandomHexColor() β†’ "#a3f4c9" | | rgbToHex(r, g, b) | Converts RGB to HEX color | rgbToHex(255, 0, 0) β†’ "#ff0000" | | hexToRgb(hex) | Converts HEX to RGB color | hexToRgb("#ff0000") β†’ "rgb(255, 0, 0)" | | isJSON(str) | Checks if a string is valid JSON | isJSON('{"name":"John"}') β†’ true | | addOrdinalSuffix(num) | Adds ordinal suffix to a number | addOrdinalSuffix(21) β†’ "21st" | | markdownToHTML(markdown) | Converts basic markdown to HTML | markdownToHTML("**Bold**") β†’ "<b>Bold</b>" |


πŸ› οΈ Contributing

Want to contribute? Awesome! πŸŽ‰
Follow these steps:

  1. Fork the repository
  2. Clone your fork:
    git clone https://github.com/NAVIN0507/getStringUtils.git
    
  3. Create a branch:
    git checkout -b feature-new-function
    
  4. Make your changes & commit:
    git commit -m "Added new string utility function"
    
  5. Push & Create a PR:
    git push origin feature-new-function
    
    Open a Pull Request (PR) on GitHub πŸš€

πŸ“œ License

This package is licensed under the ISC License.
You are free to use, modify, and distribute it with attribution.

ISC License

Permission to use, copy, modify, and/or distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright notice
and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

πŸ“’ Enjoy coding! If you like this package, don't forget to ⭐ it on GitHub! πŸš€

Related Skills

View on GitHub
GitHub Stars23
CategoryDesign
Updated8mo ago
Forks0

Languages

JavaScript

Security Score

67/100

Audited on Jul 19, 2025

No findings