aboutsummaryrefslogtreecommitdiff
path: root/node_modules/irregular-plurals/readme.md
blob: 8dea5ca7aed83b9bb7d6724fdf566410a1653489 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# irregular-plurals [![Build Status](https://travis-ci.org/sindresorhus/irregular-plurals.svg?branch=master)](https://travis-ci.org/sindresorhus/irregular-plurals)

> Map of nouns to their irregular plural form


> An irregular plural in this library is defined as a noun that cannot be made plural by applying these rules:
> - If the noun ends in an "s", "x", "z", "ch" or "sh", add "es"
> - If the noun ends in a "y" and is preceded by a consonent, drop the "y" and add "ies"
> - If the noun ends in a "y" and is preceded by a vowel, add "s"

The list is just a [JSON file](irregular-plurals.json) and can be used wherever.


## Install

```
$ npm install irregular-plurals
```


## Usage

```js
const irregularPlurals = require('irregular-plurals');

console.log(irregularPlurals['cactus']);
//=> 'cacti'

console.log(irregularPlurals);
/*
{
	addendum: 'addenda',
	alga: 'algae',
	…
}
*/
```


## Related

- [plur](https://github.com/sindresorhus/plur) - Pluralize a word


## License

MIT © [Sindre Sorhus](https://sindresorhus.com)