Skip to content

A simple zero-dependency lightweight type-safe pluralizer library for any project!

License

Notifications You must be signed in to change notification settings

Leiloukou/pluralizer.js

Repository files navigation

✏️ Pluralizer.js

NPM Package Version Code coverage badge Software License GitHub Repo stars GitHub issues

Pluralizer.js is a simple zero-dependency lightweight type-safe pluralizer library for any project!

⭐ Please give this project a star if you like it, so others can see, use, and contribute to it!

📦 Installation

You can install pluralizer.js with NPM, Yarn, or PNPM.

# NPM
$ npm install --save pluralizer.js
# Yarn
$ yarn add pluralizer.js
# PNPM
$ pnpm install --save pluralizer.js

The output should look something like this (at least with NPM):

$ npm install --save pluralizer.js
> added 1 package, and audited > X packages in 5s
>
> X packages are looking for funding
>   run `npm fund` for details
>
> found X vulnerabilities
$ # Pluralizer.js is successfully installed!

👨‍💻 Usage

Just import the function and the pluralizer and use 'em!

const numberOfCats = 3;
const myPluralizedString = pluralNew(["s"])`I have ${numberOfCats} cat${_FP}!`;

console.log(myPluralizedString); // "I have 3 cats!"

For our documentation about our other functions, see their JSDoc's @example until we create proper documentation. Thank you for your patience