A simple utility library for common string manipulation tasks in JavaScript.
This library provides the following functions:
- reverseString: Reverses the given string.
- capitalizeWords: Capitalizes the first letter of each word.
- toSnakeCase: Converts the given string to snake_case.
- toKebabCase: Converts the given string to kebab-case.
To install the package, run the following command in your project directory:
npm install string-utils-pro-sf
After installing the package, you can import the functions and use them as needed.
const {
reverseString,
capitalizeWords,
toSnakeCase,
toKebabCase,
} = require('string-utils-pro-sf');
Generate the reversed version of a string:
const reversed = reverseString('hello world');
console.log(reversed);
// Output: 'dlrow olleh'
Capitalize the first letter of every word in a string:
const capitalized = capitalizeWords('hello world');
console.log(capitalized);
// Output: 'Hello World'
Transform a string to snake_case:
const snakeCase = toSnakeCase('Hello World Test');
console.log(snakeCase);
// Output: 'hello_world_test'
Transform a string to kebab-case:
const kebabCase = toKebabCase('Hello World Test');
console.log(kebabCase);
// Output: 'hello-world-test'
** These utilities are synchronous and optimized for typical string manipulation tasks. ** Input strings should be clean and properly formatted for best results.