# naming

> naming case convertion

Latest version **1.0.6** (published 2016-11-25) · MIT license · 95 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2016-11-25 |
| First published | 2016-05-25 |
| Weekly downloads | 95 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | hujinglin |
| Maintainers | hujinglin |
| Keywords | naming, case, convention, camel, pascal, snake, kebab, caps |

## Links

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

## 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
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads
- [language-translator](https://npm.io/package/language-translator.md) — 17 weekly downloads

## Recent versions

- 1.0.6 (latest) — 2016-11-25
- 1.0.5 — 2016-10-16
- 1.0.4 — 2016-07-08
- 1.0.3 — 2016-07-07
- 1.0.2 — 2016-07-07
- 1.0.1 — 2016-05-26
- 0.0.1 — 2016-05-26
- 1.0.0 — 2016-05-25

## README

# Naming
naming case convention

## Installation

``` shell
npm install naming
```

## Usage

``` javascript
var naming = require('naming')

/** parse string **/
var str = 'apple-bananaCherry_durian'
naming(str, 'camel')    // appleBananaCakeDurian
naming(str, 'pascal')   // AppleBananaCakeDurian
naming(str, 'snake')    // apple_banana_cake_durian
naming(str, 'kebab')    // apple-banana-cherry-durian
naming(str, 'caps')     // APPLE_BANANA_CHERRY_DURIAN
naming.disperse(str)    // ['apple', 'banana', 'cherry', 'durian']

/** parse object **/
var obj = { red_apple: 0, yellow_banana: 1, green_cake: 2 }
naming(obj, 'camel')    // { redApple: 0, yellowBanana: 1, greenCake: 2 }

/** parse object deeply **/
var obj = {
  apple_list: {
    red_apple: 0,
    green_apple: 1
  }, 
  yellow_banana: 2
}
naming(obj, 'camel', true)
// => { appleList: { redApple: 0, greenApple: 1 }, yellowBanana: 2 }
```

__Note__

The consecutive '_' in the beginning or end, and $' before the actual word, and consecutive numbers will be treated as a word, such as follow

``` javascript
var str = '__$$apple-bananaCherry_durian2012__'
naming(str, 'camel')    // __$$appleBananaCherryDurian2012__
naming(str, 'pascal')   // __$$AppleBananaCherryDurian2012__
naming(str, 'snake')    // __$$-apple-banana-cherry-durian-2012__
naming(str, 'kebab')    // __$$_apple_banana_cherry_durian_2012__
naming(str, 'caps')     // __$$_APPLE_BANANA_CHERRY_DURIAN_2012__
```

## License
MIT (http://www.opensource.org/licenses/mit-license.php)

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