handlebars-helper-pluralize
v1.0.3
Published
A Handlebars helper for conditionally pluralizing words
Downloads
1,156
Maintainers
Readme
handlebars-helper-pluralize
A Handlebars helper for conditionally pluralizing words
Installation
Download node at nodejs.org and install it, if you haven't already.
npm install handlebars-helper-pluralize --save
Usage
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:
{{#pluralize 2 pony}}
The above code will output ponies
.
To include the count in the output, pass true
as a third argument:
{{#pluralize 2 pony true}}
The above will output 2 ponies
.
Tests
npm install
npm test
Dependencies
- i: custom inflections for nodejs
Dev Dependencies
- tap: A Test-Anything-Protocol library
License
ISC
Generated by package-json-to-readme