/pluralizer-js

JavaScript that converts singular to plural form of English words.

Primary LanguageJavaScript

pluralizer.js

Synopsis

Pluralizer (7.19 KB) returns the plural form of whatever word you give it.

pluralizer.run('goose') --> 'geese'

It can also take an array of arrays, each having a numeric quantity and corresponding word, and return well formed english with an Oxford comma.

pluralizer.read([[2,'orange'],[3,'peach'],[5,'cherry']]) --> '2 oranges, 3 peaches, and 5 cherries.'.
pluralizer.read([[2,'orange'],[3,'peach']]) --> '2 oranges and 3 peaches.'.

Pluralizer.js returns 2 public methods .read and .run, and one public property, .help.

🍎 pluralizer.read returns a string with an Oxford comma in arrays of 3 or more items.

Installation

🚀 Embed pluralizer.min.js in your javascript when putting in production for best page loading performance.

Contribute

If you found a bug, have any questions or want to contribute please let me know, ron@rack.pub.

License

Ron Royston, https://rack.pub, MIT License