# ember-inflector

> String inflections for Ember applications.

Latest version **7.0.0** (published 2026-09-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install ember-inflector
pnpm add ember-inflector
yarn add ember-inflector
bun add ember-inflector
```

## Health

**Score 60/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; has provenance; recently updated.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 7.0.0 |
| Published | 2026-09-10 |
| First published | 2014-12-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 66.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| Author | Stefan Penner, Manuel Wiedenmann and Trace Wax |
| Maintainers | ef4, rwjblue, fivetanley, stefanpenner, ofbriggs, nullvoxpopuli |
| Keywords | ember-addon |

## Links

- npm: https://www.npmjs.com/package/ember-inflector
- Repository: https://github.com/emberjs/ember-inflector
- npm.io page: https://npm.io/package/ember-inflector

## Dependencies (2)

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

## Recent versions

- 7.0.0 (latest) — 2026-09-10
- 6.0.0 — 2025-03-12
- 5.0.2 — 2024-10-24
- 5.0.1 — 2024-08-05
- 5.0.0 — 2024-07-24
- 4.0.3 — 2024-07-12
- 4.0.2 — 2021-06-11
- 4.0.1 — 2020-12-04
- 3.0.1 — 2019-07-01
- 3.0.0 — 2018-04-30
- 2.3.0 — 2018-04-20
- 2.2.0 — 2018-03-27
- 2.1.0 — 2017-11-11
- 2.0.1 — 2017-06-05
- 2.0.0 — 2017-04-22
- … 19 more at https://npm.io/package/ember-inflector/versions

## README

# Ember Inflector [![CI](https://github.com/emberjs/ember-inflector/workflows/CI/badge.svg)](https://github.com/emberjs/ember-inflector/actions/)

Ember Inflector is a library for inflecting words between plural and singular forms. Ember Inflector aims to be compatible with [ActiveSupport::Inflector](http://api.rubyonrails.org/classes/ActiveSupport/Inflector.html) from Ruby on Rails, including the ability to add your own inflections in your app.

## Compatibility

- Ember.js v4.8 or above
- Embroider or ember-auto-import v2

## Installation

```shell
ember install ember-inflector
```

## Usage

All methods are always available from the `ember-inflector` module:

```javascript
import Inflector from 'ember-inflector';
import { singularize, pluralize } from 'ember-inflector';

Inflector.inflector.singularize("tacos"); // taco
Inflector.inflector.pluralize("taco"); // tacos

singularize("tacos"); // taco
pluralize("taco"); // tacos

pluralize(2, "taco"); // 2 tacos
pluralize(2, "tacos", { withoutCount: true }); // tacos
```

### Custom Rules

If necessary you can setup special inflection rules for your application:

```javascript
import Inflector from 'ember-inflector';

Inflector.inflector.irregular('person', 'people');
Inflector.inflector.uncountable('sheep');

```

### Template Helpers

#### pluralize

Pluralize a word

```hbs
{{pluralize "taco"}} -> tacos
```

Specify a count with the word, with the pluralization being based on the number of items.

```hbs
{{pluralize 1 "taco"}} -> 1 taco
{{pluralize 2 "taco"}} -> 2 tacos
```

Specify a count with the word, with the pluralization being based on the number of items. Specify `without-count=true` to return on the word without the number.

```hbs
{{pluralize 1 "taco" without-count=true}} -> taco
{{pluralize 2 "taco" without-count=true}} -> tacos
```

#### singularize

```hbs
{{singularize 'octopi'}} -> octopus
```

### TypeScript

Types are published with the addon, so no `@types/*` package is needed.

If your app is not yet using strict mode templates, register the template
helpers with [Glint](https://typed-ember.gitbook.io/glint) by extending the
addon's registry:

```typescript
import type EmberInflectorRegistry from 'ember-inflector/template-registry';

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

## Contributing

See the [Contributing](CONTRIBUTING.md) guide for details.

## License

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

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