# kasi

> A collection of functions for working with different casings.

Latest version **2.0.1** (published 2026-01-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install kasi
pnpm add kasi
yarn add kasi
bun add kasi
```

## Health

**Score 65/100 (B)** — status: stable.

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2026-01-21 |
| First published | 2023-09-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 19.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 33 |
| Maintainers | fabiospampinato |
| Keywords | case, casing, check, covert, copy |

## Links

- npm: https://www.npmjs.com/package/kasi
- Repository: https://github.com/fabiospampinato/kasi
- Homepage: https://github.com/fabiospampinato/kasi#readme
- Issues: https://github.com/fabiospampinato/kasi/issues
- npm.io page: https://npm.io/package/kasi

## 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

- 2.0.1 (latest) — 2026-01-21
- 2.0.0 — 2026-01-21
- 1.1.2 — 2026-01-20
- 1.1.1 — 2025-01-18
- 1.1.0 — 2023-11-10
- 1.0.1 — 2023-09-18
- 1.0.0 — 2023-09-17

## README

# Kasi

A collection of functions for working with different casings.

## Install

```sh
npm install kasi
```

## Functions

| Check                             | Convert                           | Extra             |
| --------------------------------- | --------------------------------- | ----------------- |
| [isCamelCase](#iscamelcase)       | [toCamelCase](#tocamelcase)       | [apply](#apply)   |
| [isConstantCase](#isconstantcase) | [toConstantCase](#toconstantcase) | [copy](#copy)     |
| [isDotCase](#isdotcase)           | [toDotCase](#todotcase)           | [detect](#detect) |
| [isKebabCase](#iskebabcase)       | [toKebabCase](#tokebabcase)       |                   |
| [isLowerCase](#islowercase)       | [toLowerCase](#tolowercase)       |                   |
| [isPascalCase](#ispascalcase)     | [toPascalCase](#topascalcase)     |                   |
| [isPathCase](#ispathcase)         | [toPathCase](#topathcase)         |                   |
| [isSnakeCase](#issnakecase)       | [toSnakeCase](#tosnakecase)       |                   |
| [isTitleCase](#istitlecase)       | [toTitleCase](#totitlecase)       |                   |
| [isUpperCase](#isuppercase)       | [toUpperCase](#touppercase)       |                   |

### Check

These functions allow you to check if a string is using a specific casing.

#### `isCamelCase`

```ts
import {isCamelCase} from 'kasi';

isCamelCase ( 'fooBar' ); // => true
isCamelCase ( 'foo-bar' ); // => false
```

#### `isConstantCase`

```ts
import {isConstantCase} from 'kasi';

isConstantCase ( 'FOO_BAR' ); // => true
isConstantCase ( 'fooBar' ); // => false
```

#### `isDotCase`

```ts
import {isDotCase} from 'kasi';

isDotCase ( 'foo.bar' ); // => true
isDotCase ( 'fooBar' ); // => false
```

#### `isKebabCase`

```ts
import {isKebabCase} from 'kasi';

isKebabCase ( 'foo-bar' ); // => true
isKebabCase ( 'fooBar' ); // => false
```

#### `isLowerCase`

```ts
import {isLowerCase} from 'kasi';

isLowerCase ( 'foo' ); // => true
isLowerCase ( 'Foo' ); // => false
```

#### `isPascalCase`

```ts
import {isPascalCase} from 'kasi';

isPascalCase ( 'FooBar' ); // => true
isPascalCase ( 'fooBar' ); // => false
```

#### `isPathCase`

```ts
import {isPathCase} from 'kasi';

isPathCase ( 'foo/bar' ); // => true
isPathCase ( 'fooBar' ); // => false
```

#### `isSnakeCase`

```ts
import {isSnakeCase} from 'kasi';

isSnakeCase ( 'foo_bar' ); // => true
isSnakeCase ( 'fooBar' ); // => false
```

#### `isTitleCase`

```ts
import {isTitleCase} from 'kasi';

isTitleCase ( 'Foo Bar' ); // => true
isTitleCase ( 'fooBar' ); // => false
```

#### `isUpperCase`

```ts
import {isUpperCase} from 'kasi';

isUpperCase ( 'FOO' ); // => true
isUpperCase ( 'foo' ); // => false
```

### Convert

These functions allow you to convert a string to a specific casing.

#### `toCamelCase`

```ts
import {toCamelCase} from 'kasi';

toCamelCase ( 'foo-bar' ); // => 'fooBar'
toCamelCase ( 'foo_bar' ); // => 'fooBar'
```

#### `toConstantCase`

```ts
import {toConstantCase} from 'kasi';

toConstantCase ( 'fooBar' ); // => 'FOO_BAR'
toConstantCase ( 'foo-bar' ); // => 'FOO_BAR'
```

#### `toDotCase`

```ts
import {toDotCase} from 'kasi';

toDotCase ( 'fooBar' ); // => 'foo.bar'
toDotCase ( 'foo-bar' ); // => 'foo.bar'
```

#### `toKebabCase`

```ts
import {toKebabCase} from 'kasi';

toKebabCase ( 'fooBar' ); // => 'foo-bar'
toKebabCase ( 'foo_bar' ); // => 'foo-bar'
```

#### `toLowerCase`

```ts
import {toLowerCase} from 'kasi';

toLowerCase ( 'FooBar' ); // => 'foo bar'
toLowerCase ( 'foo-bar' ); // => 'foo bar'
```

#### `toPascalCase`

```ts
import {toPascalCase} from 'kasi';

toPascalCase ( 'foo-bar' ); // => 'FooBar'
toPascalCase ( 'foo_bar' ); // => 'FooBar'
```

#### `toPathCase`

```ts
import {toPathCase} from 'kasi';

toPathCase ( 'fooBar' ); // => 'foo/bar'
toPathCase ( 'foo-bar' ); // => 'foo/bar'
```

#### `toSnakeCase`

```ts
import {toSnakeCase} from 'kasi';

toSnakeCase ( 'fooBar' ); // => 'foo_bar'
toSnakeCase ( 'foo-bar' ); // => 'foo_bar'
```

#### `toTitleCase`

```ts
import {toTitleCase} from 'kasi';

toTitleCase ( 'fooBar' ); // => 'Foo Bar'
toTitleCase ( 'foo-bar' ); // => 'Foo Bar'
```

#### `toUpperCase`

```ts
import {toUpperCase} from 'kasi';

toUpperCase ( 'fooBar' ); // => 'FOO BAR'
toUpperCase ( 'foo-bar' ); // => 'FOO BAR'
```

### Extra

These extra functions perform other operations related to casings.

#### `apply`

Transform a string to the given casing. Useful in combination with `detect`.

```ts
import {apply} from 'kasi';

apply ( 'foo-bar', 'camel' ); // => 'fooBar'
apply ( 'foo-bar', 'constant' ); // => 'FOO_BAR'
```

#### `copy`

This function copies the casing of a string to another string, character by character. The two strings must have the same length.

```ts
import {copy} from 'kasi';

copy ( 'sIlLy', 'lions' ); // => 'lIoNs'
copy ( 'SiLlY', 'lions' ); // => 'LiOnS'
```

#### `detect`

This function detects the casing of a string. Useful in combination with `apply`.

```ts
import {detect} from 'kasi';

detect ( 'fooBar' ); // => 'camel'
detect ( 'FOO_BAR' ); // => 'constant'
detect ( ' foo BAR ' ); // => 'unknown'
```

## Related

- **[Kasi for VSCode](https://marketplace.visualstudio.com/items?itemName=fabiospampinato.kasi)**: The official companion extension for Kasi, for quickly changing the casing of your selections.

## License

MIT © Fabio Spampinato

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