DEV Community

Manu Kumar Pal
Manu Kumar Pal

Posted on

๐Ÿš€ Convert Any String Case in 1 Line! Meet case-text-utils ๐Ÿงฐ

Hey devs! ๐Ÿ‘‹ I just released a tiny, powerful package called case-text-utils โ€” a utility that helps you convert between string cases effortlessly.

๐Ÿ”ง Step 1: Install it

npm install case-text-utils
Enter fullscreen mode Exit fullscreen mode

๐Ÿง  Step 2: Import what you need

import {
  toCamel,
  toSnake,
  toKebab,
  toPascal,
  convertCase
} from 'case-text-utils';
Enter fullscreen mode Exit fullscreen mode

โšก Step 3: Use it (Examples)

toCamel('hello_world-text');      // โ†’ "helloWorldText"
toSnake('helloWorldText');        // โ†’ "hello_world_text"
toPascal('hello_world-text');     // โ†’ "HelloWorldText"

_Or use the universal converter_:

convertCase('user_name-key', 'pascal');
// โ†’ "UserNameKey"
Enter fullscreen mode Exit fullscreen mode

โœ… Why use case-text-utils?

๐Ÿชถ Just 2KB
๐Ÿ“ฆ Zero dependencies
๐Ÿงผ Clean ESM
๐ŸŒ Works in both Node.js & browser
๐Ÿ” One-liner conversions

๐Ÿ“ฆ NPM Link:- https://www.npmjs.com/package/case-text-utils

โญ If you find it useful, give it a try and star the repo!Feel free to share feedback or suggestions. ๐Ÿ™Œ

Top comments (0)