plur

WebJar for plur

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

plur
Last Version

Last Version

3.1.1
Release Date

Release Date

Type

Type

jar
Description

Description

plur
WebJar for plur
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/sindresorhus/plur

Download plur

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/plur/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>plur</artifactId>
    <version>3.1.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/plur/
implementation 'org.webjars.npm:plur:3.1.1'
// https://jarcasting.com/artifacts/org.webjars.npm/plur/
implementation ("org.webjars.npm:plur:3.1.1")
'org.webjars.npm:plur:jar:3.1.1'
<dependency org="org.webjars.npm" name="plur" rev="3.1.1">
  <artifact name="plur" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='plur', version='3.1.1')
)
libraryDependencies += "org.webjars.npm" % "plur" % "3.1.1"
[org.webjars.npm/plur "3.1.1"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : irregular-plurals jar [2.0.0,3)

Project Modules

There are no modules declared in this project.

plur

Pluralize a word

Install

$ npm install plur

Usage

const plur = require('plur');

plur('unicorn', 4);
//=> 'unicorns'

plur('puppy', 2);
//=> 'puppies'

plur('box', 2);
//=> 'boxes'

plur('cactus', 2);
//=> 'cacti'

API

plur(word, plural?, count)

word

Type: string

Word to pluralize.

plural

Type: string
Default:

  • Irregular nouns will use this list.
  • Words ending in s, x, z, ch, sh will be pluralized with -es (eg. foxes).
  • Words ending in y that are preceded by a consonant will be pluralized by replacing y with -ies (eg. puppies).
  • All other words will have "s" added to the end (eg. days).

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

Type: number

Count to determine whether to use singular or plural.

Versions

Version
3.1.1
2.1.2
2.0.0
1.0.0