@daniakash/pluralize

Tiny library to pluralize any word

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@daniakash/pluralize
100.0.23 years ago3 years agoMinified + gzip package size for @daniakash/pluralize in KB

Readme


Motivation

Pluralizing text is a very annoying task & this library aims to provide a lightweight, friendly API to achieve it.

Installation

yarn add @daniakash/pluralize

# or

npm i @daniakash/pluralize

Usage

import { pluralize } from "@daniakash/pluralize";

Pluralizing words that simply adds 's'

pluralize("apple", count); //=> apples

Pluralizing words that add a custom suffix

pluralize("child", count, { pluralSuffix: "ren" }); //=> children

Pluralizing words that needs a different word altogether

pluralize("sheep", count, { pluralTerm: "sheep" }); //=> sheep

Licenses

MIT © DaniAkashtwitter