Package Exports
- curslo-string-utilities
- curslo-string-utilities/src/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (curslo-string-utilities) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
📦 Curslo String Utilities
Curslo String Utilities is a lightweight JavaScript package that provides essential string manipulation functions. It helps developers format, transform, and analyze strings easily.
🚀 Features
- ✅ Capitalize: Convert the first letter of a word to uppercase.
- ✅ Camel Case: Convert text to camelCase format.
- ✅ Snake Case: Convert text to snake_case format.
- ✅ Kebab Case: Convert text to kebab-case format.
- ✅ Reverse String: Reverse the characters in a string.
- ✅ Truncate String: Shorten a string to a specified length.
- ✅ Palindrome Check: Determine if a word is a palindrome.
📥 Installation
npm install curslo-string-utilities
or with Yarn:
yarn add curslo-string-utilities
or with pnpm:
pnpm add curslo-string-utilities
📖 Usage
Import the Package
const {
capitalize,
toCamelCase,
toSnakeCase,
toKebabCase,
reverseString,
truncateString,
isPalindrome
} = require("curslo-string-utilities");
🔹 Available Functions
1️⃣ Capitalize
Converts the first letter of a string to uppercase.
console.log(capitalize("hello")); // "Hello"
2️⃣ Convert to Camel Case
Transforms a string into camelCase.
console.log(toCamelCase("hello world example")); // "helloWorldExample"
3️⃣ Convert to Snake Case
Transforms a string into snake_case.
console.log(toSnakeCase("hello world example")); // "hello_world_example"
4️⃣ Convert to Kebab Case
Transforms a string into kebab-case.
console.log(toKebabCase("hello world example")); // "hello-world-example"
5️⃣ Reverse a String
Reverses the characters in a string.
console.log(reverseString("hello")); // "olleh"
6️⃣ Truncate a String
Shortens a string to a specified length.
console.log(truncateString("hello world", 5)); // "hello..."
7️⃣ Check if a String is a Palindrome
Determines whether a given word or phrase is a palindrome.
console.log(isPalindrome("madam")); // true
console.log(isPalindrome("hello")); // false
🛠️ Contributing
Contributions are welcome! If you find a bug or have an improvement suggestion, feel free to open an issue or submit a pull request.
📜 License
This project is licensed under the MIT License.
🔗 GitHub Repo: Curslo String Utilities
📦 npm Package: curslo-string-utilities