handlebars-pluralize
Handlebars helper for pluralizing any words in any language.
Installation
npm i handlebars-pluralize --save
Usage
Use pluralize
helper for pluralization. There are three reserved keys for determining phrases:
- one — 1, 21, 101 etc.
- few — 2, 3, 4, 22, 102 etc.
- many — 5, 6, 7, 25, 105 etc.
Also you can provide explicit rule for value. See the example below.
const hbs = ;const pluralize = ;hbs;const template = hbs; let str = ;// "I want 1 beer" str = ;// "I want two beers" str = ;// "I want 5 beers"
Tests
npm install
npm test
Dev Dependencies
License
MIT