# ember-cli-string-utils

> string utils extracted for other addons and blueprints

Latest version **1.1.0** (published 2017-01-23) · ISC license · 0 weekly downloads

## Install

```sh
npm install ember-cli-string-utils
pnpm add ember-cli-string-utils
yarn add ember-cli-string-utils
bun add ember-cli-string-utils
```

## 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.1.0 |
| Published | 2017-01-23 |
| First published | 2015-08-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | ember-cli contributors |
| Maintainers | kellyselden, rwjblue, stefanpenner |

## Links

- npm: https://www.npmjs.com/package/ember-cli-string-utils
- Repository: https://github.com/ember-cli/ember-cli-string-utils
- Homepage: https://github.com/ember-cli/ember-cli-string-utils#readme
- Issues: https://github.com/ember-cli/ember-cli-string-utils/issues
- npm.io page: https://npm.io/package/ember-cli-string-utils

## Recent versions

- 1.1.0 (latest) — 2017-01-23
- 1.0.0 — 2015-08-19

## README

# ember-cli-string-utils

Library for string utils extracted for other addons and blueprints.

## Installation

```
$ npm i ember-cli-string-utils
```

## Code Example

**How to use in project :**

```javascript
var stringUtils = require("ember-cli-string-utils");

stringUtils.camelize('action_name');	   // 'actionName'
stringUtils.camelize('css-class-name');    // 'cssClassName'
stringUtils.camelize('my favorite items'); // 'myFavoriteItems'
stringUtils.camelize('My Favorite Items'); // 'myFavoriteItems'
```

## Usage

### 1) decamelize:

**Converts a camelized string into all lowercase separated by underscores.**


```javascript
  decamelize('innerHTML');         // 'inner_html'
  decamelize('action_name');       // 'action_name'
  decamelize('css-class-name');    // 'css-class-name'
  decamelize('my favorite items'); // 'my favorite items'
```

### 2) dasherize:

**Replaces underscores, spaces, or camelCase with dashes.**

```javascript
  dasherize('innerHTML');         // 'inner-html'
  dasherize('action_name');       // 'action-name'
  dasherize('css-class-name');    // 'css-class-name'
  dasherize('my favorite items'); // 'my-favorite-items'
```
### 3) camelize:

**Returns the lowerCamelCase form of a string.**

```javascript
  camelize('innerHTML');          // 'innerHTML'
  camelize('action_name');        // 'actionName'
  camelize('css-class-name');     // 'cssClassName'
  camelize('my favorite items');  // 'myFavoriteItems'
  camelize('My Favorite Items');  // 'myFavoriteItems'
```

### 4) classify:

**Returns the UpperCamelCase form of a string.**

```javascript
  'innerHTML'.classify();          // 'InnerHTML'
  'action_name'.classify();        // 'ActionName'
  'css-class-name'.classify();     // 'CssClassName'
  'my favorite items'.classify();  // 'MyFavoriteItems'
  ```

### 5) underscore:

**More general than decamelize. Returns the lower\_case\_and\_underscored form of a string.**

```javascript
  'innerHTML'.underscore();          // 'inner_html'
  'action_name'.underscore();        // 'action_name'
  'css-class-name'.underscore();     // 'css_class_name'
  'my favorite items'.underscore();  // 'my_favorite_items'
```

### 6) capitalize:

**Returns the Capitalized form of a string.**

```javascript
  'innerHTML'.capitalize()         // 'InnerHTML'
  'action_name'.capitalize()       // 'Action_name'
  'css-class-name'.capitalize()    // 'Css-class-name'
  'my favorite items'.capitalize() // 'My favorite items'
```

## Author

**ember-cli contributors**


## License
**ISC**

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