https://github.com/imevanc/casenator
Casenator - The Ultimate String Transformation Utility
https://github.com/imevanc/casenator
camelcase javascript js kebab-case lowercase pascalcase reverse-strings string-manipulation substring uppercase
Last synced: 4 months ago
JSON representation
Casenator - The Ultimate String Transformation Utility
- Host: GitHub
- URL: https://github.com/imevanc/casenator
- Owner: imevanc
- License: mit
- Created: 2024-08-29T22:25:53.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-12-25T13:31:53.000Z (5 months ago)
- Last Synced: 2024-12-25T14:24:25.917Z (5 months ago)
- Topics: camelcase, javascript, js, kebab-case, lowercase, pascalcase, reverse-strings, string-manipulation, substring, uppercase
- Language: JavaScript
- Homepage:
- Size: 7.15 MB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# π¦ΈββοΈ Casenator - The Ultimate String Transformation Utility
[](https://www.npmjs.com/package/casenator)
[](https://img.shields.io/npm/l/casenator)**Casenator** is your go-to tool for all things string transformation. Whether you need to switch between `camelCase`, `PascalCase`, `kebab-case` and many more! π
---
## π₯ Features
- π **CamelCase** β Convert any string to `camelCase`.
- π **PascalCase** β Format strings in `PascalCase`.
- π **KebabCase** β Get your strings into `kebab-case`.
- π **Uppercase** β Make everything UPPERCASE.
- π‘ **Lowercase** β Convert text to lowercase.
- π **Reverse** β Reverse the characters in a string.
- π **Substring** β Extract specific parts of your string.
- π¦ **CapitalCase** - Convert any string to `Capital Case`.
- π **DotCase** - Format string in `dot.case`.
- π¦ **ConstantCase** - Get your string into `CONSTANT_CASE`.
- πΈ **NoCase** - Convert any string to `no case`.
- π¬ **SnakeCase** - Format string in `snake_case`.
- π¦ **PathCase** - Get your string into `/pathCase`.
- 𦧠**CobolCase** - Format string in `COBOL-CASE`.
- π« **LeetSpeak** - Make everything `1337 5p34k`.
- π¦ **ConvertWithCustomDelimiter** - Convert any string to `custom-delimiter where - is the new delimiter`.---
## π Installation
First, add **Casenator** to your project via npm:```bash
npm install casenator
```---
π οΈ Usage
Hereβs how to start transforming your strings with Casenator:```javascript
// Import the functions you need from Casenator
import {
toCamelCase,
toPascalCase,
toKebabCase,
toUpperCase,
reverseString,
substring,
toCapitalCase,
toConstantCase,
toDotCase,
toNoCase,
toSnakeCase,
toPathCase,
toCobolCase,
toLeetSpeak,
convertToCustomDelimiter
} from 'casenator';// Camel Case
console.log(toCamelCase('Hello world!')); // 'helloWorld'// Pascal Case
console.log(toPascalCase('hello world')); // 'HelloWorld'// Kebab Case
console.log(toKebabCase('Hello World!')); // 'hello-world'// Uppercase
console.log(toUpperCase('hello world')); // 'HELLO WORLD'// Reverse a String
console.log(reverseString('Hello')); // 'olleH'// Substring
console.log(substring('hello world', 0, 5)); // 'hello'// Capital Case
console.log(toCapitalCase('hello world')); // 'Hello World'// Dot Case
console.log(toDotCase('hello-world')); // 'hello.world'// Constant Case
console.log(toConstantCase('hello world')); // 'HELLO_WORLD'// No Case
console.log(toNoCase('hello--world')); // 'hello world'// Snake Case
console.log(toSnakeCase('hello world')); // 'hello_world'// Path Case
console.log(toPathCase('hello world')); // '/helloWorld'// Cobol Case
console.log(toCobolCase('hello world')); // 'HELLO-WORLD'// Leet Speak
console.log(toLeetSpeak('hello world')); // 'h3110 w021d'// Convert With Custom Delimiter
console.log(convertWithCustomDelimiter("hello-world", "-", ".")); // 'hello.world'
```---
## π₯ Why Casenator?
- π **Lightweight** β Minimal footprint and blazingly fast.
- π‘οΈ **Robust** β Handles invalid inputs with helpful errors.
- π οΈ **Versatile** β Perfect for all your string formatting needs.
- β **Tested** β Comprehensive unit test coverage for all edge cases.---
## π License
This project is licensed under the **MIT License**. See the [LICENCE](LICENCE) file for details.---
## π Contributing
Feel free to contribute, raise issues, or suggest features to make **casenator** even better! π€