# @trenskow/caseit

> Small library for converting between different casing.

Latest version **1.4.34** (published 2026-10-05) · BSD-2-Clause license · 0 weekly downloads

## Install

```sh
npm install @trenskow/caseit
pnpm add @trenskow/caseit
yarn add @trenskow/caseit
bun add @trenskow/caseit
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.4.34 |
| Published | 2026-10-05 |
| First published | 2020-01-16 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Kristian Trenskow |
| Maintainers | trenskow |
| Keywords | case, string, convert |

## Links

- npm: https://www.npmjs.com/package/@trenskow/caseit
- Repository: https://github.com/trenskow/caseit
- Homepage: https://github.com/trenskow/caseit#readme
- Issues: https://github.com/trenskow/caseit/issues
- npm.io page: https://npm.io/package/@trenskow/caseit

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 1.4.34 (latest) — 2026-10-05
- 1.4.33 — 2026-09-21
- 1.4.32 — 2026-09-16
- 1.4.31 — 2026-09-16
- 1.4.30 — 2026-08-03
- 1.4.29 — 2026-07-27
- 1.4.28 — 2026-07-13
- 1.4.27 — 2026-07-02
- 1.4.26 — 2026-06-25
- 1.4.25 — 2026-06-08
- 1.4.24 — 2026-05-19
- 1.4.23 — 2026-05-04
- 1.4.22 — 2026-03-28
- 1.4.21 — 2026-02-14
- 1.4.20 — 2026-02-01
- … 44 more at https://npm.io/package/@trenskow/caseit/versions

## README

@trenskow/caseit
----

A small library for changing the case of a string.

# Usage

Import using the following example.

````javascript
const caseit = require('@trenskow/caseit');
````

– or

````javascript
import caseit from '@trenskow/caseit'
````

## Converting

To convert from one case type to another use the following example.

```javascript
const myCamelCase = caseit('my_camel_case', 'camel'); // return 'myCamelCase';
```

You can convert from any format to any other format. Supported formats are.

 * `camel` - camelCase
 * `pascal` - PascalCase
 * `snake` - snake_case
 * `domain` - domain.case
 * `kebab` - kebab-case
 * `title` - Title Case
 * `http` - Http-Case

> Default format (if omitted) is `camel` (because it is the Javascript default).

## Detecting

To detect the casing of a string do as the following example.

````javascript
caseit.detect('MyCase'); // returns ['pascal']
caseit.detect('Hello'); // returns ['pascal', 'title', 'http']
````

## Getting the words

You can also get the lowercase variants of all the words in a string by using the following example.

````javascript
caseit.words('MyCase'); // returns ['my', 'case']
````

# LICENSE

3-Clause BSD (see LICENSE).

---
_Source: https://npm.io/package/@trenskow/caseit · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
