# plural

> rule-based plural library

Latest version **1.1.0** (published 2018-01-28) · MIT license · 0 weekly downloads

## Install

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

## 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 | 2018-01-28 |
| First published | 2013-10-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12 |
| Author | Shuan Wang |
| Maintainers | swang |
| Keywords | plural, rule-based |

## Links

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

## Recent versions

- 1.1.0 (latest) — 2018-01-28
- 1.0.1 — 2018-01-28
- 0.2.1 — 2018-01-28
- 0.3.1 — 2018-01-28
- 1.0.0 — 2018-01-12
- 0.3.0 — 2017-04-02
- 0.2.0 — 2015-10-12
- 0.1.6 — 2014-08-10
- 0.1.5 — 2014-08-10
- 0.1.4 — 2014-02-02
- 0.1.3 — 2013-10-28
- 0.1.2 — 2013-10-22
- 0.1.1 — 2013-10-12
- 0.1.0 — 2013-10-07

## README

# plural
plural is a rule-based plural library for node.js

[![Build Status](https://travis-ci.org/swang/plural.png?branch=master)](https://travis-ci.org/swang/plural)

this library's aim is to convert most words into their plural form. it's not going to handle every single case but you can fill those in with your own rules (using `plural.addRule`)

# install

```
npm install plural
```

# example

```js
var plural = require('plural')

console.log(plural('zebra', 1)) // returns singular 'zebra'
console.log(plural('zebra', 2)) // returns 'zebras'
console.log(plural('zebra')) // returns 'zebras' (if no parameters, always returns plural)
```

```
zebra
zebras
zebras
```

you can also force it to monkeypatch onto the String prototype
```js
var plural = require('plural')
plural.monkeyPatch()

console.log('zebra'.plural(1))
console.log('zebra'.plural(2))
console.log('zebra'.plural())
```

```
zebra
zebras
zebras
```

you can remove it from the String prototype by using `plural.unmonkeyPatch()`

# license
MIT

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