Skip to content

Commit

Permalink
Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
btxtiger committed Nov 27, 2023
1 parent 7f46bda commit ed7e891
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
# change-case-all

Change case functions for all cases in TypeScript and JavaScript.

![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)

Combined version of all [`change-case`](https://github.com/blakeembrey/change-case) methods, so you do not need to install them separately.
Tree shaking should still work if you use a module bundler.
ESM and CJS bundles are included, also backwards compatible with [email protected].

`[email protected]` introduces a `Case` helper class, which can be used to access all methods.

## Usage

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

### Via class
```ts
import { Case } from 'change-case-all';

const camel = Case.camel('test string'); // testString
const upper = Case.upper('test string'); // TEST STRING
```

### Via functions
```ts
import { camelCase, upperCase, ... } from 'change-case-all';

Expand All @@ -27,7 +35,9 @@ const upper = upperCase('test string'); // TEST STRING
```

## Changelog

### 2.0.0

- Updated dependencies to `[email protected]`
- ParamCase → now KebabCase
- HeaderCase → now TrainCase
Expand All @@ -36,10 +46,12 @@ const upper = upperCase('test string'); // TEST STRING
- `[email protected]` failing in tests, thus kept at `3.0.3`

## Links
- **Original project:** https://github.com/blakeembrey/change-case

- **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';
Expand Down Expand Up @@ -68,7 +80,6 @@ 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
Expand Down Expand Up @@ -99,5 +110,4 @@ lowerFirst = lowerCaseFirst(str); // test string
upperFirst = upperCaseFirst(str); // Test string
isUpper = isUpperCase(str); // false
isLower = isLowerCase(str); // true

```
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as spongeCase1 from 'sponge-case';
import * as swapCase1 from 'swap-case';
import * as titleCase1 from 'title-case';

// Core
// Exports
export const camelCase = changeCase1.camelCase;
export const capitalCase = changeCase1.capitalCase;
export const constantCase = changeCase1.constantCase;
Expand Down

0 comments on commit ed7e891

Please sign in to comment.