handlebars-helper-pluralize

1.0.3 • Public • Published

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

Package Sidebar

Install

npm i handlebars-helper-pluralize

Weekly Downloads

86

Version

1.0.3

License

ISC

Last publish

Collaborators

  • zeke