@jsheaven/case-converter
v0.0.1
Published
A versatile JavaScript library for converting strings between camel case, Pascal case, snake case, underscore and other.
Downloads
39
Readme
This package provides utility functions for converting strings between various text casing formats in JavaScript/TypeScript. It supports conversion between camelCase, PascalCase, snake_case, and kebab-case. The package can be used to standardize the casing of strings, particularly when dealing with APIs, file names, or data serialization.
- As a developer, I want to convert strings from one casing format to another.
- As a developer, I want to ensure consistency in the casing of strings within my application.
- As a developer, I want to have a library that is easy to use and integrates well with my existing codebase.
- ✅ Supports conversion between camelCase, PascalCase, snake_case, and kebab-case.
- ✅ Provides functions for both converting strings from one format to another and vice versa.
- ✅ Lightweight and easy to integrate into existing projects.
- ✅ Provides TypeScript support with type definitions.
- ✅ Just
600 byte
nano sized (ESM, gizpped) - ✅ Tree-shakable and side-effect free
- ✅ Runs on Windows, Mac, Linux, CI tested
- ✅ First class TypeScript support
- ✅ 100% Unit Test coverage
- yarn:
yarn add @jsheaven/case-converter
- npm:
npm install @jsheaven/case-converter
import { convert } from '@jsheaven/case-converter'
const inputString = 'hello_world'
const convertedString = convert('SnakeCase', 'CamelCase', inputString)
console.log(convertedString) // Output: helloWorld
const { convert } = require('@jsheaven/case-converter')
const inputString = 'hello_world'
const convertedString = convert('SnakeCase', 'CamelCase', inputString)
console.log(convertedString) // Output: helloWorld