String Utility Functions
This package provides a set of utility functions to manipulate and format strings in various common formats such as CamelCase, Capitalize, LowerCase, UpperCase, SnakeCase, and KebabCase. These functions can be used in JavaScript and TypeScript projects to facilitate the handling of text data.
Installation
You can install this package using npm:
npm install your-package-name
Or using yarn:
yarn add your-package-name
Replace your-package-name
with the actual name of your package.
Usage
After installation, you can import and use the string utility functions in your project like so:
import { CamelCase, Capitalize, LowerCase, UpperCase, SnakeCase, KebabCase } from 'your-package-name';
console.log(CamelCase('hello-world'));
console.log(Capitalize('hello'));
console.log(LowerCase('HELLO'));
console.log(UpperCase('hello'));
console.log(SnakeCase('HelloWorld'));
console.log(KebabCase('HelloWorld'));
Functions
-
CamelCase(str: string): string
Converts a string to CamelCase.
-
Capitalize(str: string): string
Converts the first character of a string to uppercase.
-
LowerCase(str: string): string
Converts all characters in a string to lowercase.
-
UpperCase(str: string): string
Converts all characters in a string to uppercase.
-
SnakeCase(str: string): string
Converts a string to SnakeCase.
-
KebabCase(str: string): string
Converts a string to KebabCase.
Contributing
Contributions are welcome! Please feel free to submit a pull request or create an issue if you have any suggestions, questions, or bug reports.
License
This project is licensed under the MIT License - see the LICENSE file for details.