
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
js-simple-plurals
Advanced tools
Just a set of plural functions for different languages
$ bower install js-simple-plurals
$ npm install js-simple-plurals
var plural = require('./node/en');
function pluralizeEn(number, one, many) {
var rules = [one, many];
var position = plural(number);
return rules[position];
}
console.log('2 ' + pluralizeEn(2, 'day', 'days')); // prints '2 days'
<form>
<label>
Number
<input type="number" id="number" value="1">
</label>
<div id="text"></div>
</form>
<script src="web/en.js"></script>
<script>
var number = document.getElementById('number');
var text = document.getElementById('text');
function pluralizeEn(number, one, many) {
var rules = [one, many];
var position = plural.en(number);
return rules[position];
}
function updateText() {
var content = number.value + ': ' + pluralizeEn(
number.value,
'day',
'days'
);
document.getElementById('text').textContent = content;
}
document.getElementById('number').addEventListener('change', updateText);
updateText();
</script>
Plural rules follow the guideline found in the Unicode CLDR Charts on Language Plural Rules. This plural rules are based on rules generated by universal-i18n.
FAQs
Just a set of plural functions for different languages
We found that js-simple-plurals demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.