Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

plur

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

plur - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

6

index.js
'use strict';
var irregularPlurals = require('irregular-plurals');
module.exports = function (str, plural, count) {
if (typeof plural === 'number') {
if (str in irregularPlurals) {
plural = irregularPlurals[str];
} else if (typeof plural === 'number') {
count = plural;

@@ -5,0 +9,0 @@

17

package.json
{
"name": "plur",
"version": "2.0.0",
"description": "Naively pluralize a word",
"version": "2.1.0",
"description": "Pluralize a word",
"license": "MIT",

@@ -16,3 +16,3 @@ "repository": "sindresorhus/plur",

"scripts": {
"test": "node test.js"
"test": "xo && ava"
},

@@ -32,8 +32,13 @@ "files": [

"str",
"naive",
"simple"
"irregular",
"noun",
"nouns"
],
"dependencies": {
"irregular-plurals": "^1.0.0"
},
"devDependencies": {
"ava": "0.0.4"
"ava": "*",
"xo": "*"
}
}
# plur [![Build Status](https://travis-ci.org/sindresorhus/plur.svg?branch=master)](https://travis-ci.org/sindresorhus/plur)
> Naively pluralize a word
> Pluralize a word

@@ -16,3 +16,3 @@

```js
var plur = require('plur');
const plur = require('plur');

@@ -22,9 +22,12 @@ plur('unicorn', 4);

plur('hero', 'heroes', 4);
//=> 'heroes'
plur('puppy', 2);
//=> 'puppies'
plur('box', 2);
//=> 'boxes'
plur('cactus', 2);
//=> 'cacti'
```
Words ending in *s*, *x*, *z*, *ch*, *sh* will be pluralized with *-es*, like
*foxes*. Words ending in *y* will be pluralized by replacing *y* with *-ies* as
in *puppies*. The plural suffix will match the case of the last letter in the word.

@@ -44,6 +47,12 @@ ## API

Type: `string`
Default: `word` + `s`
Default: Words ending in *s*, *x*, *z*, *ch*, *sh* will be pluralized with *-es*, like
*foxes*. Words ending in *y* will be pluralized by replacing *y* with *-ies* as
in *puppies*. Irregular nouns will use this [list](https://github.com/sindresorhus/irregular-plurals/blob/master/irregular-plurals.json).
Pluralized word.
The plural suffix will match the case of the last letter in the word.
This option is only for extreme edge-cases. You probably won't need it.
#### count

@@ -50,0 +59,0 @@

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc