@daniakash/pluralize
v0.0.2
Published
Tiny library to pluralize any word
Downloads
6
Readme
Pluralize
A very tiny library to pluralize words!
PRs Welcome 👍✨
- 📦 Installation
- ℹ️ Usage
- 💡 Examples
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/pluralizeUsage
import { pluralize } from "@daniakash/pluralize";Pluralizing words that simply adds 's'
pluralize("apple", count); //=> applesPluralizing words that add a custom suffix
pluralize("child", count, { pluralSuffix: "ren" }); //=> childrenPluralizing words that needs a different word altogether
pluralize("sheep", count, { pluralTerm: "sheep" }); //=> sheepLicenses
MIT © DaniAkash
