Socket
Socket
Sign inDemoInstall

irregular-plurals

Package Overview
Dependencies
0
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    irregular-plurals

Map of nouns to their irregular plural form


Version published
Weekly downloads
1.5M
increased by11.9%
Maintainers
1
Install size
7.09 kB
Created
Weekly downloads
 

Package description

What is irregular-plurals?

The irregular-plurals npm package is designed to provide a simple way to handle irregular plural forms of words in English. It is particularly useful for applications that need to dynamically generate text that conforms to grammatical rules.

What are irregular-plurals's main functionalities?

Get the plural form of an irregular noun

This feature allows you to retrieve the plural form of an irregular noun. You simply pass the singular form of the noun to the `get` method, and it returns the corresponding plural form.

const irregularPlurals = require('irregular-plurals');
console.log(irregularPlurals.get('mouse')); // Outputs: 'mice'

Other packages similar to irregular-plurals

Readme

Source

irregular-plurals

Map of nouns to their irregular plural form

An irregular plural in this library is defined as a noun that cannot be made plural by applying these rules:

  • If the noun ends in an "s", "x", "z", "ch" or "sh", add "es"
  • If the noun ends in a "y" and is preceded by a consonant, drop the "y" and add "ies"
  • If the noun ends in a "y" and is preceded by a vowel, add "s"

The list is just a JSON file and can be used anywhere.

Install

npm install irregular-plurals

Usage

import irregularPlurals from 'irregular-plurals';

console.log(irregularPlurals.get('cactus'));
//=> 'cacti'

console.log(irregularPlurals);
/*
Map {
	[addendum, 'addenda'],
	[alga, 'algae'],
	…
}
*/
  • plur - Pluralize a word

Keywords

FAQs

Last updated on 30 Apr 2024

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc