plural-for

1.0.4 • Public • Published

plural-for: tiny node module to pluralize English words

This is meant to be small and stupidly simple.

For the absolutely simplest alternative, see sorp.

For smarter/bigger options, you've got:

Install

npm install --save plural-for

Example Usage

var pluralFor = require('plural-for')
var asWord = require('zero-to-nine').asWord

let nOcelots = 0
let nWolves = 2

console.log(`There will be ${asWord(nOcelots)} ${pluralFor(nOcelots, 'ocelot')} left after building the wall.`)
// output: "There will be zero ocelots left after building the wall."

console.log(`There will be only ${asWord(nWolves)} Mexican gray ${pluralFor(nWolves, 'wolf', 'wolves')} left, sadly.`)
// output: There will be only two Mexican gray wolves left, sadly.

See also: more about biodiversity threats example.

Readme

Keywords

Package Sidebar

Install

npm i plural-for

Weekly Downloads

2

Version

1.0.4

License

ISC

Unpacked Size

136 kB

Total Files

6

Last publish

Collaborators

  • techieshark