1.0.0 • Published 4 years ago

@alexcarpenter/eleventy-plugin-pluralize v1.0.0

Weekly downloads
1
License
MIT
Repository
-
Last release
4 years ago

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.