Pluralize
Pluralize and singularize any word.
Installation
npm install pluralize --save
bower install pluralize --save
Node
var pluralize =
AMD
<script>
tag
Why fork?
The original library was using UMD and didn't play consistently between electron and browser, we forked it and made a few customizations to fix that.
Why?
This module uses a pre-defined list of rules, applied in order, to singularize or pluralize a given word. There are many cases where this is useful, such as any automation based on user input. For applications where the word(s) are known ahead of time, you can use a simple ternary (or function) which would be a much lighter alternative.
Usage
//=> "tests" //=> "test" //=> "tests" //=> "1 test" //=> "5 tests" pluralize //=> "regexes"pluralizepluralize //=> "regexii" pluralize //=> "single"pluralizepluralize //=> "singular" pluralize //=> "irregulars"pluralizepluralize //=> "regular" pluralize //=> "papers"pluralizepluralize //=> "paper"
License
MIT