Skip to main content
Home

@luca/cases@1.0.0
Built and signed on GitHub Actions

Works with
This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score100%
Downloads149/wk
Published2 years ago (1.0.0)

A collection of functions for converting strings between different cases.

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

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@luca/cases

Import symbol

import * as cases from "@luca/cases";
or

Import directly with a jsr specifier

import * as cases from "jsr:@luca/cases";