🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

pluralize

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pluralize

Pluralize and singularize any word

8.0.0
latest
Version published
Weekly downloads
14M
2.55%
Maintainers
1
Weekly downloads
 
Created

What is pluralize?

The pluralize npm package is a simple utility for converting words between their singular and plural forms. It can also handle irregular forms and uncountable nouns.

What are pluralize's main functionalities?

Pluralization

Converts a singular noun to its plural form, or vice versa, depending on the count provided. It also correctly handles uncountable nouns.

const pluralize = require('pluralize');
console.log(pluralize('fish')); // 'fish'
console.log(pluralize('fish', 5)); // 'fish'
console.log(pluralize('fish', 1)); // 'fish'

Singularization

Converts a plural noun to its singular form.

const pluralize = require('pluralize');
console.log(pluralize.singular('wolves')); // 'wolf'

Adding Irregular Rules

Allows the addition of custom irregular rules for nouns that do not follow the normal pluralization pattern.

const pluralize = require('pluralize');
pluralize.addIrregularRule('goose', 'geese');
console.log(pluralize('goose')); // 'geese'

Adding Uncountable Rules

Allows the addition of uncountable rules for nouns that should not be pluralized.

const pluralize = require('pluralize');
pluralize.addUncountableRule('equipment');
console.log(pluralize('equipment')); // 'equipment'

Other packages similar to pluralize

FAQs

Package last updated on 25 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts