SmartCase - Intelligent String Casing Library
SmartCase is a JavaScript library that provides intelligent string casing and capitalization functions, offering a range of formatting options to simplify string manipulation tasks in your applications.
Features
- Title Case: Convert strings to title case.
- Sentence Case: Convert strings to sentence case.
- Camel Case: Convert strings to camel case.
- Pascal Case: Convert strings to pascal case.
- Snake Case: Convert strings to snake case.
- Kebab Case: Convert strings to kebab case.
- Constant Case: Convert strings to constant case.
- Dot Case: Convert strings to dot case.
- Path Case: Convert strings to path case.
- Smart Case: Unique smart case that handles special cases and exceptions intelligently.
Custom rules for each case
Installation
npm install smart-case
Usage
const { titleCase, camelCase, smartCase } = require("smart-case");
console.log(titleCase("hello world"));
console.log(camelCase("hello world"));
console.log(constantCase("hello world"));
const customTitleCaseRules = {
wordsToAlwaysUpperCase: ["world"],
};
console.log(titleCase("hello world", customTitleCaseRules));
const customConstantCaseRules = {
wordsToAlwaysLowerCase: ['world']
};
console.log(constantCase("hello world", customConstantCaseRules));
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- This library is inspired by the need for consistent and intelligent string casing in JavaScript applications.
Author