npm package: @fczbkk/convert-case
Description: Utility for converting strings between camelCase, snake_case, kebab-case, etc.
Author: Riki Fridrich
Latest version: 1.0.0

# Convert case

Utility for converting strings between camelCase, snake_case, kebab-case, etc.

[![npm](https://img.shields.io/npm/v/@fczbkk/convert-case.svg?maxAge=2592000)](https://www.npmjs.com/package/@fczbkk/convert-case)
[![npm](https://img.shields.io/github/license/fczbkk/convert-case.svg?maxAge=2592000)](https://github.com/fczbkk/convert-case/blob/master/LICENSE)
[![David](https://img.shields.io/david/fczbkk/convert-case.svg?maxAge=2592000)](https://david-dm.org/fczbkk/convert-case)
[![Travis](https://img.shields.io/travis/fczbkk/convert-case.svg?maxAge=2592000)](https://travis-ci.org/fczbkk/convert-case)

## How to use

Install the library via NPM:

```shell
npm install @fczbkk/convert-case --save
```

Then use in your project like this:

```javascript
import convertCase from '@fczbkk/convert-case';

// convert between any combination of cases
var human_string = 'aaa bbb ccc';
var camel_string = convertCase(human_string, 'human', 'camel'); // aaaBbbCcc
var pascal_string = convertCase(camel_string, 'camel', 'pascal'); // AaaBbbCcc
var upper_string = convertCase(pascal_string, 'pascal', 'upper'); // AAA_BBB_CCC
var kebab_string = convertCase(upper_string, 'upper', 'kebab'); // aaa-bbb-ccc
```

## Documentation

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

### CapitalizationType

Type of capitalization: human, camel, snake, kebab, upper or pascal.

### convertCase

Converts string from one type of capitalization to another.

**Parameters**

-   `input` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** 
-   `source_case` **[CapitalizationType](#capitalizationtype)** 
-   `target_case` **[CapitalizationType](#capitalizationtype)** 

Returns **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** 

### parseCharacters

Breaks input into array containing metadata about each character.

**Parameters**

-   `input` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** 
-   `source_case` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** 

Returns **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>** 

## Bug reports, feature requests and contact

If you found any bugs, if you have feature requests or any questions, please, either [file an issue at GitHub](https://github.com/fczbkk/convert-case/issues) or send me an e-mail at <a href="mailto:riki@fczbkk.com">riki@fczbkk.com</a>. The best bug report is a pull request with failing test.

## Contributing

-   All pull requests are welcome.
-   Use `npm run dev` task for local development. It will start a watch task that will run tests against each code change.
-   Don't forget to add/update tests and documentation.

Thank you.

## License

Convert case is published under the [MIT license](https://github.com/fczbkk/convert-case/blob/master/LICENSE).