Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Built and signed on GitHub Actions
latest
lucacasonato/casesA collection of functions for converting strings between different cases.
This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers




JSR Score
100%
Published
a year ago (1.0.0)
A collection of functions for converting strings between different cases.
This module provides functions for converting strings between camel case, snake case, kebab case, title case, pascal case, and constant case. It also provides a function for splitting a string into pieces based on spaces, dashes, underscores, and camel case.
All functions can be used with either a single string or an array of strings. The single string will be split into pieces using the splitPieces function.
import * as cases from "@luca/cases"; cases.splitPieces("helloWorld") // ["hello", "world"] cases.camelCase("hello world") // "helloWorld" cases.snakeCase("helloWorld") // "hello_world" cases.kebabCase("hello_world") // "hello-world" cases.titleCase("hello-world") // "Hello World" cases.pascalCase(["hello", "world"]) // "HelloWorld" cases.constantCase("hello world") // "HELLO_WORLD"
Built and signed on
GitHub Actions
Add Package
deno add jsr:@luca/cases
Import symbol
import * as cases from "@luca/cases";
Import directly with a jsr specifier
import * as cases from "jsr:@luca/cases";
Add Package
pnpm i jsr:@luca/cases
pnpm dlx jsr add @luca/cases
Import symbol
import * as cases from "@luca/cases";
Add Package
yarn add jsr:@luca/cases
yarn dlx jsr add @luca/cases
Import symbol
import * as cases from "@luca/cases";
Add Package
npx jsr add @luca/cases
Import symbol
import * as cases from "@luca/cases";
Add Package
bunx jsr add @luca/cases
Import symbol
import * as cases from "@luca/cases";