Plur
Pluralize a word
Install / Use
/learn @sindresorhus/PlurREADME
plur
Pluralize a word
Install
npm install plur
Usage
import plur from 'plur';
plur('rainbow');
//=> 'rainbows'
plur('unicorn', 4);
//=> 'unicorns'
plur('puppy', 2);
//=> 'puppies'
plur('box', 2);
//=> 'boxes'
plur('cactus', 2);
//=> 'cacti'
API
plur(word, plural?, count?)
word
Type: string
The 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).
Explicitly provide the 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
The count to determine whether to use singular or plural. If omitted, defaults to plural.
Related Skills
node-connect
342.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
85.3kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
342.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
342.5kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
