@luca-pal/string-toolkit
v1.1.0
Published
A small JavaScript library for string manipulation functions.
Maintainers
Readme
@luca-pal/string-toolkit
A small JavaScript library that provides useful string manipulation functions such as converting text to snake_case or to kebab-case.
Features
- Convert strings to snake_case
- Convert strings to kebab-case
Installation
Using npm
npm install @luca-pal/string-toolkitUsing yarn
yarn add @luca-pal/string-toolkitUsage
Import the library:
const { toSnakeCase, toKebabCase } = require("@luca-pal/string-toolkit");Example:
console.log(toSnakeCase("Hello World"));
// Output: hello_worldconsole.log(toKebabCase("Hello World"));
// Output: hello-worldAPI
toSnakeCase(string)
Converts a string to snake_case (lowercase words separated by underscores).
Example:
toSnakeCase("Hello World");
// hello_worldtoKebabCase(string)
Converts a string to kebab-case (lowercase words separated by dashes).
Example:
toKebabCase("Hello World");
// hello-worldContributing
Contributions are welcome!
Please:
- Fork the repository
- Create a feature branch
- Commit your changes
- Submit a pull request
See CONTRIBUTING.md for details.
License
This project is licensed under the MIT License. See LICENSE.md for details.
