npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@jarrodek/pluralize

v1.0.2

Published

Pluralize and singularize any word

Downloads

226

Readme

Pluralize (ES Fork)

Modern, ES-ready fork of the original pluralize library. The original is no longer maintained—this fork is actively updated and supports ES modules out of the box.

Pluralize is a robust TypeScript library for pluralizing and singularizing English (and some Unicode) words. It is designed for developers who need reliable inflection, custom rule extension, and runtime flexibility.

Installation

npm install @jarrodek/pluralize
# or
yarn add @jarrodek/pluralize

ES Module Usage

import pluralize from '@jarrodek/pluralize';

CommonJS Usage

const pluralize = require('@jarrodek/pluralize');

Browser

<!-- Stop polluting the global namespace! -->

Why Pluralize?

  • Actively maintained fork: The original library is unmaintained; this fork is modernized and ES module compatible.
  • TypeScript-first: Full type definitions and modern build pipeline.
  • Extensible: Add custom plural/singular/irregular/uncountable rules at runtime.
  • Reliable inflection: Handles edge cases, Unicode, and irregular forms.

API & Examples

Basic Usage

pluralize('test') // "tests"
pluralize('test', 1) // "test"
pluralize('test', 5) // "tests"
pluralize('test', 1, true) // "1 test"
pluralize('test', 5, true) // "5 tests"
pluralize('蘋果', 2, true) // "2 蘋果"

Advanced API

Pluralize a word

pluralize.plural('person') // "people"
pluralize.plural('bus') // "buses"

Singularize a word

pluralize.singular('geese') // "goose"
pluralize.singular('cars') // "car"

Check if a word is plural or singular

pluralize.isPlural('dogs') // true
pluralize.isSingular('dog') // true

Add custom rules at runtime

pluralize.addPluralRule(/gex$/i, 'gexii')
pluralize.plural('regex') // "regexii"

pluralize.addSingularRule(/singles$/i, 'singular')
pluralize.singular('singles') // "singular"

pluralize.addIrregularRule('person', 'people')
pluralize.plural('person') // "people"
pluralize.singular('people') // "person"

pluralize.addUncountableRule('sheep')
pluralize.plural('sheep') // "sheep"
pluralize.singular('sheep') // "sheep"

Use Cases

  • UI/UX: Display item counts: "1 file", "2 files".
  • Natural Language Processing: Normalize user input for search, categorization, or reporting.
  • Domain Extensions: Add custom inflection rules for medical, legal, or technical vocabulary.
  • Internationalization: Handles Unicode and non-English words for basic pluralization.

Extending & Testing

  • Add new rules using the API methods above.
  • All new rules and API extensions should be covered by unit tests in tests/unit/.
  • See tests/unit/methods.spec.ts for test patterns.

Maintainers & Fork Status

This is a fork of blakeembrey/pluralize, which is no longer maintained. This fork is actively updated, ES module compatible, and modernized for developer use.

License

MIT