A Handlebars helper for conditionally pluralizing words
npm install handlebars-helper-pluralizeA Handlebars helper for conditionally pluralizing words
Download node at nodejs.org and install it, if you haven't already.
``sh`
npm install handlebars-helper-pluralize --save
`js`
var express = require("express")
var hbs = require("hbs")
hbs.registerHelper("pluralize", require("handlebars-helper-pluralize"))
var app = express()
app.set("view engine", "hbs")
// etc...
Use the helper in your Handlebars template:
`hbs`
{{#pluralize 2 pony}}
The above code will output ponies.
To include the count in the output, pass true as a third argument:
`hbs`
{{#pluralize 2 pony true}}
The above will output 2 ponies.
`sh``
npm install
npm test
- i: custom inflections for nodejs
- tap: A Test-Anything-Protocol library
ISC
_Generated by package-json-to-readme_