Toolbox-XToolbox-X

Manage Noun Forms

Shared pre-configured instance of the Pluralizer class for English noun singular/plural conversions.

pluralizer

The pluralizer is a default shared instance of the Pluralizer class. It comes preloaded with standard English rules, irregular forms, and uncountable nouns.

Acknowledgement

This utility is heavily inspired by Blake Embrey’s excellent pluralize package.

When to Use

  • Use this instance when you don’t need multiple configurations.
  • If you need isolated or custom rules, you can instantiate the class directly as new Pluralizer().

Features

  • Convert words between singular and plural forms.
  • Built-in support for irregular forms (e.g. childchildren).
  • Handles uncountable nouns (e.g. fish, information).
  • Modify rules dynamically at runtime:
    • Add pluralization or singularization rules.
    • Add irregular forms.
    • Add uncountable words or regex patterns.

Example Usage

playground.ts

Extending Rules

Since pluralizer is a shared instance, modifications to it at runtime affect all consumers:

import { pluralizer } from 'toolbox-x/pluralizer';

// Add a custom plural rule
pluralizer.addPluralRule(/(foo)$/i, '$1bars');

// Add a custom singular rule
pluralizer.addSingularRule(/(bars)$/i, '$1');

// Add an uncountable noun
pluralizer.addUncountable('luggage');

// Add an irregular word
pluralizer.addIrregular('cactus', 'cacti');

See Also

Last updated: Sun, Jun 14, 2026 07:52:00PM (UTC)

On this page