just-pluralize
Version:
A simple singularized tool for all your pluralization problems.
36 lines (23 loc) β’ 1.16 kB
Markdown
A simple singularized tool for all your pluralization problems.
All you have to do is install the package, import the 'pluralize' method and you are ready to get going.
```
$ npm i just-pluralize
```
```
import { pluralize } from 'just-pluralize';
```
```
pluralize('son', 1) // -> 'son' πΆπ»
pluralize('dog', 3) // -> 'dogs' π π π
pluralize('candy', 6, 'candies') // -> 'candies' π¬ π¬ π¬ π¬ π¬ π¬
```
| Name | Type | Description |
| ----------------------- | ------ | ------------------------------------------------------------------------------------------- |
| singular word(required) | string | This the word that you want to pluralize |
| count(optional) | number | The count on which the word would be pluralized |
| plural word(optional) | string | This word must be passed in case the plural word is different from the passed singular word |