@alexcarpenter/eleventy-plugin-pluralize

v1.0.0
An Eleventy plugin to pluralize text.
eleventy 11ty

eleventy-plugin-pluralize

An Eleventy plugin to pluralize text.

Installation

$ npm install @alexcarpenter/eleventy-plugin-pluralize
const pluralize = require('@alexcarpenter/eleventy-plugin-pluralize');

module.exports = eleventyConfig => {
  eleventyConfig.addPlugin(pluralize);
}

Usage

{{ 'unicorn' | pluralize(4) }} //=> 'unicorns'

{{ 'puppy' | pluralize(2) }} //=> 'puppies'

{{ 'box' | pluralize(2) }} //=> 'boxes'

{{ 'cactus' | pluralize(2) }} //=> 'cacti'

Credit

This plugin is simply a wrapper for plur, an awesome little package by sindresorhus. All credit for the pluralization functionality of this plugin goes to them.

npm i @alexcarpenter/eleventy-plugin-pluralize

Metadata

  • MIT
  • Whatever
  • Alex Carpenter
  • released 5/22/2020

Downloads

Maintainers