# ember-cli-string-helpers

> String helpers for Ember

Latest version **8.0.1** (published 2025-07-22) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 45/100 (D)** — status: stable.

Positive: esm support; no vulnerabilities; has provenance.

Warnings: low downloads; no types.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 8.0.1 |
| Published | 2025-07-22 |
| First published | 2016-11-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >= 20 |
| Dependencies | 2 |
| Unpacked size | 35.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 74 |
| Author | Lauren Tan |
| Maintainers | rwwagner90, knownasilya, romulomachado |
| Keywords | ember-addon, helpers, string helpers, strings |

## Links

- npm: https://www.npmjs.com/package/ember-cli-string-helpers
- Repository: https://github.com/adopted-ember-addons/ember-cli-string-helpers
- Issues: https://github.com/adopted-ember-addons/ember-cli-string-helpers/issues
- npm.io page: https://npm.io/package/ember-cli-string-helpers

## Dependencies (2)

- [decorator-transforms](https://npm.io/package/decorator-transforms.md) ^2.3.0
- [@embroider/addon-shim](https://npm.io/package/@embroider/addon-shim.md) ^1.10.0

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 8.0.1 (latest) — 2025-07-22
- 8.0.0 — 2025-07-21
- 7.1.0 — 2025-07-17
- 7.0.0 — 2025-07-17
- 6.1.0 — 2021-05-08
- 6.0.1 — 2021-04-23
- 5.0.0 — 2020-06-16
- 4.0.7 — 2020-06-15
- 4.0.6 — 2020-01-03
- 4.0.5 — 2019-09-26
- 4.0.4 — 2019-09-09
- 4.0.3 — 2019-08-30
- 4.0.2 — 2019-08-27
- 4.0.0 — 2019-08-05
- 3.0.0 — 2019-06-18
- … 18 more at https://npm.io/package/ember-cli-string-helpers/versions

## README

# ember-cli-string-helpers

![Download count all time](https://img.shields.io/npm/dt/ember-cli-string-helpers.svg)
[![CI](https://github.com/adopted-ember-addons/ember-cli-string-helpers/actions/workflows/ci.yml/badge.svg)](https://github.com/adopted-ember-addons/ember-cli-string-helpers/actions/workflows/ci.yml)
[![npm version](https://badge.fury.io/js/ember-cli-string-helpers.svg)](https://badge.fury.io/js/ember-cli-string-helpers)
[![Ember Observer Score](http://emberobserver.com/badges/ember-cli-string-helpers.svg)](http://emberobserver.com/addons/ember-cli-string-helpers)

String helpers for Ember. Extracted from the great [DockYard's ember-composable-helpers](https://github.com/DockYard/ember-composable-helpers/).

> [!WARNING]  
> If you are using single file components you most likely do not need this addon as it's just a wrapper on `@ember/string` methods. You can import most methods directly from `@ember/string` in your components, or migrate to something like [change-case](https://www.npmjs.com/package/change-case).

## Compatibility

* Ember.js v3.28 or above
* Ember CLI v4.4 or above
* Node.js v20 or above

## Installation

```shell
ember install ember-cli-string-helpers
```

## Available helpers

- [ember-cli-string-helpers](#ember-cli-string-helpers)
  - [Compatibility](#compatibility)
  - [Installation](#installation)
  - [Available helpers](#available-helpers)
  - [Usage](#usage)
      - [`camelize`](#camelize)
      - [`capitalize`](#capitalize)
      - [`classify`](#classify)
      - [`dasherize`](#dasherize)
      - [`html-safe`](#html-safe)
      - [`humanize`](#humanize)
      - [`lowercase`](#lowercase)
      - [`titleize`](#titleize)
      - [`trim`](#trim)
      - [`truncate`](#truncate)
      - [`underscore`](#underscore)
      - [`uppercase`](#uppercase)
      - [`w`](#w)
  - [Glint usage](#glint-usage)
  - [Template Tag usage](#template-tag-usage)
  - [See also](#see-also)
  - [License](#license)

## Usage

#### `camelize`

Camelizes a string using `Ember.String.camelize`.

```hbs
{{camelize "hello jim bob"}}
{{camelize stringWithDashes}}
```

Output: `helloJimBob`

**[⬆️ back to top](#available-helpers)**

#### `capitalize`

Capitalizes a string using `Ember.String.capitalize`.

```hbs
{{capitalize "hello jim bob"}}
{{capitalize fullName}}
```

Output: `Hello jim bob`

**[⬆️ back to top](#available-helpers)**

#### `classify`

Classifies a string using `Ember.String.classify`.

```hbs
{{classify "hello jim bob"}}
{{classify stringWithDashes}}
```

Output: `HelloJimBob`

**[⬆️ back to top](#available-helpers)**

#### `dasherize`

Dasherizes a string using `Ember.String.dasherize`.

```hbs
{{dasherize "whatsThat"}}
{{dasherize phrase}}
```

Output: `whats-that`

**[⬆️ back to top](#available-helpers)**

#### `html-safe`

Mark a string as safe for unescaped output with Ember templates using `Ember.String.htmlSafe`.

```hbs
{{html-safe "<div>someString</div>"}}
{{html-safe unsafeString}}
```

**[⬆️ back to top](#available-helpers)**

#### `humanize`

Removes dashes and underscores from a string, capitalizes the first letter and makes the rest of the string lower case.

```hbs
{{humanize "some-string"}}
{{humanize phrase}}
```

Output: `Some string`

**[⬆️ back to top](#available-helpers)**

#### `lowercase`

Lowercases a string.

```hbs
{{lowercase "People Person's Paper People"}}
{{lowercase phrase}}
```

Output: `people person's paper people`

**[⬆️ back to top](#available-helpers)**

#### `titleize`

Capitalizes every word separated by a white space or a dash.

```hbs
{{titleize "my big fat greek wedding"}}
{{titleize phrase}}
```

Output: `My Big Fat Greek Wedding`

**[⬆️ back to top](#available-helpers)**

#### `trim`

Trim a string.

```hbs
{{trim "  Lorem ipsum dolor sit amet, consectetur adipiscing elit.   "}}
{{trim phrase}}
```

Output: `Lorem ipsum dolor sit amet, consectetur adipiscing elit.`

#### `truncate`

Truncates a string with a characterLimit and optionally adds an ellipsis to the end.

```hbs
{{truncate "Lorem ipsum dolor sit amet, consectetur adipiscing elit." 20 true}}
{{truncate phrase characterLimit useEllipsis}}
```

Output: `Lorem ipsum dolor...`

**[⬆️ back to top](#available-helpers)**

#### `underscore`

Underscores a string using `Ember.String.underscore`.

```hbs
{{underscore "whatsThat"}}
{{underscore phrase}}
```

Output: `whats_that`

**[⬆️ back to top](#available-helpers)**

#### `uppercase`

Uppercases a string.

```hbs
{{uppercase "loud noises"}}
{{uppercase phrase}}
```

Output: `LOUD NOISES`

**[⬆️ back to top](#available-helpers)**

#### `w`

Splits a string on whitespace and/or turns multiple words into an array.

```hbs
{{#each (w "First" "Second" "Last") as |rank|}}
  Our {{rank}} place winner is ...
{{/each}}
```

or:

```hbs
{{#each (w "First Second Last") as |rank|}}
  Our {{rank}} place winner is ...
{{/each}}
```

See also: [Ember `w` documentation](https://api.emberjs.com/ember/release/classes/String/methods/w?anchor=w)

**[⬆️ back to top](#available-helpers)**

## Glint usage

If you are using [Glint](https://typed-ember.gitbook.io/glint/) and `environment-ember-loose`, you can add all the helpers to your app at once by adding

```ts
import type EmberCliStringHelpersRegistry from 'ember-cli-string-helpers/template-registry';
```

to your app's e.g. `types/glint.d.ts` file, and making sure your registry extends from EmberCliStringHelpersRegistry:

```ts
declare module '@glint/environment-ember-loose/registry' {
  export default interface Registry
    extends EmberCliStringHelpersRegistry {
      // ...
    }
}
```

## Template Tag usage

```gjs
import { camelize } from 'ember-cli-string-helpers';

<template>
  {{camelize "hello jim bob"}}
</template>
```

## See also

* [ember-composable-helpers](https://github.com/dockyard/ember-composable-helpers)
* [ember-math-helpers](https://github.com/RobbieTheWagner/ember-math-helpers)
* [ember-truth-helpers](https://github.com/jmurphyau/ember-truth-helpers)

## License

This project is licensed under the [MIT License](LICENSE.md).

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