# change-case-all

> All change-case methods bundled in a single module

Latest version **2.1.0** (published 2023-11-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install change-case-all
pnpm add change-case-all
yarn add change-case-all
bun add change-case-all
```

## Health

**Score 30/100 (F)** — status: abandoned.

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2023-11-27 |
| First published | 2020-04-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 28.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 22 |
| Author | Jonas Gnioui |
| Maintainers | btxtiger |
| Keywords | change-case, camel-case, pascal-case, change-case, snake-case, lowercase, uppercase, constant-case |

## Links

- npm: https://www.npmjs.com/package/change-case-all
- Repository: https://github.com/btxtiger/change-case-all
- Homepage: https://github.com/btxtiger/change-case-all#readme
- Issues: https://github.com/btxtiger/change-case-all/issues
- npm.io page: https://npm.io/package/change-case-all

## Dependencies (4)

- [swap-case](https://npm.io/package/swap-case.md) ^3.0.2
- [title-case](https://npm.io/package/title-case.md) ^3.0.3
- [change-case](https://npm.io/package/change-case.md) ^5.2.0
- [sponge-case](https://npm.io/package/sponge-case.md) ^2.0.2

## 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.1.0 (latest) — 2023-11-27
- 2.0.1 — 2023-11-26
- 2.0.0 — 2023-11-26
- 1.0.15 — 2022-09-08
- 1.0.14 — 2021-03-15
- 1.0.13 — 2021-03-15
- 1.0.12 — 2020-04-25
- 1.0.11 — 2020-04-25
- 1.0.10 — 2020-04-14
- 1.0.9 — 2020-04-12
- 1.0.8 — 2020-04-12
- 1.0.7 — 2020-04-12
- 1.0.6 — 2020-04-12
- 1.0.5 — 2020-04-12
- 1.0.3 — 2020-04-12
- … 3 more at https://npm.io/package/change-case-all/versions

## README

# change-case-all

![CI](https://github.com/btxtiger/change-case-all/actions/workflows/ci.yml/badge.svg)
[![npm](https://img.shields.io/npm/v/change-case-all.svg)](https://www.npmjs.com/package/change-case-all)
[![npm](https://img.shields.io/npm/dm/change-case-all.svg)](https://www.npmjs.com/package/change-case-all)
[![npm](https://img.shields.io/librariesio/release/npm/change-case-all)](https://www.npmjs.com/package/change-case-all)

Change case functions for all cases in TypeScript and JavaScript.
Combined version of all [`change-case`](https://github.com/blakeembrey/change-case) methods, so you do not need to install them separately.
ESM and CJS bundles are included, also backwards compatible with change-case@4.1.0.

`change-case-all@2.0.0` introduces a `Case` helper class, which can be used to access all methods.

## Usage

```shell script
npm install --save change-case-all
```

### Browser / ESM
```ts
import { Case } from 'change-case-all';
const camel = Case.camel('test string'); // testString
const upper = Case.upper('test string'); // TEST STRING


import { camelCase, upperCase, ... } from 'change-case-all';
const camel = camelCase('test string'); // testString
const upper = upperCase('test string'); // TEST STRING
```

### Node.js
```ts
const { Case } = require('change-case-all');
const camel = Case.camel('foo-bar'); // fooBar
const snake = Case.snake('fooBar'); // foo_bar

const { camelCase, snakeCase } = require('change-case-all');
const camel = camelCase('foo-bar'); // fooBar
const snake = snakeCase('fooBar'); // foo_bar
```

## Changelog

### 2.1.0
- Bundle dependencies in module to support Node.js

### 2.0.0

- Updated dependencies to `change-case@5.2.0`
- ParamCase &rarr; now KebabCase
- HeaderCase &rarr; now TrainCase
- Create mjs and cjs bundles
- Introduce `Case` helper class: e.g. `Case.camel('test string'); // testString`
- `TitleCase@4.1.0` failing in tests, thus kept at `3.0.3`

## Links

- **Original project:** https://github.com/blakeembrey/change-case
- **Bundled browser friendly version:** https://github.com/nitro404/change-case-bundled

## Methods

### Class based usage
```ts
import { Case } from 'change-case-all';

const str = 'test string';

camel       = Case.camel(str);               // testString
capital     = Case.capital(str);             // Test String
constant    = Case.constant(str);            // TEST_STRING
dot         = Case.dot(str);                 // test.string
no          = Case.no(str);                  // test string
pascal      = Case.pascal(str);              // TestString
path        = Case.path(str);                // test/string
sentence    = Case.sentence(str);            // Test string
snake       = Case.snake(str);               // test_string
train       = Case.train(str);               // Test-String
kebap       = Case.kebap(str);               // test-string
sponge      = Case.sponge(str);              // TeSt StRiNg
swapCase    = Case.swap(str);                // TEST STRING
title       = Case.title(str);               // Test String
uppper      = Case.upper(str);               // TEST STRING
localeUpper = Case.localeUpper(str, 'en');   // TEST STRING
lower       = Case.lower(str);               // test string
localeLower = Case.localeLower(str, 'en');   // test string
lowerFirst  = Case.lowerFirst(str);          // test string
upperFirst  = Case.upperFirst(str);          // Test string
isUpper     = Case.isUpper(str);             // false
isLower     = Case.isLower(str);             // true
```

### Function based usage
```ts
import { camelCase, upperCase, ... } from 'change-case-all';

const str = 'test string';

camel       = camelCase(str);               // testString
capital     = capitalCase(str);             // Test String
constant    = constantCase(str);            // TEST_STRING
dot         = dotCase(str);                 // test.string
no          = noCase(str);                  // test string
pascal      = pascalCase(str);              // TestString
path        = pathCase(str);                // test/string
sentence    = sentenceCase(str);            // Test string
snake       = snakeCase(str);               // test_string
train       = trainCase(str);               // Test-String
kebap       = kebapCase(str);               // test-string
sponge      = spongeCase(str);              // TeSt StRiNg
swapCase    = swapCase(str);                // TEST STRING
title       = titleCase(str);               // Test String
uppper      = upperCase(str);               // TEST STRING
localeUpper = localeUpperCase(str, 'en');   // TEST STRING
lower       = lowerCase(str);               // test string
localeLower = localeLowerCase(str, 'en');   // test string
lowerFirst  = lowerCaseFirst(str);          // test string
upperFirst  = upperCaseFirst(str);          // Test string
isUpper     = isUpperCase(str);             // false
isLower     = isLowerCase(str);             // true
```

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