
Security News
Socket Releases Free Certified Patches for Critical vm2 Sandbox Escape
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.
react-pluralize
Advanced tools
A tiny pluralization component. Also check out react-since, another tiny component that presents time passed in a humanistic format.
npm install react-pluralize --save
import Pluralize from 'react-pluralize'
<Pluralize singular={'view'} count={3} /> => 3 views
<Pluralize singular={'person'} plural={'people'} count={3} /> => 3 people
<Pluralize singular={'like'} showCount={false}/> => like
<Pluralize singular={'click'} count={0} /> => 0 clicks
<Pluralize singular={'hit'} count={0} zero={'Nothing to show'}/> => Nothing to show
singular (required)(String) The singular form of the noun
plural (optional)(default: singular + 's')(String) The plural form of the noun if required (i.e. when the plural form isn't just 's' added to the end)
count (optional)(default: 1)(Number) The count value used to determine whether the singular or plural form should be used.
showCount (optional)(default: true)(Boolean) If you would prefer not to see the count in the output then set this prop to false.
zero (optional)(default: null)(String) If you would like to show a different message when the count is 0 you can provide this prop.
className (optional)(default: null)(String)
style (optional)(default: {})(Object)
FAQs
Render nouns in singular or plural form
The npm package react-pluralize receives a total of 12,526 weekly downloads. As such, react-pluralize popularity was classified as popular.
We found that react-pluralize 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.

Security News
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.

Research
Five malicious NuGet packages impersonate Chinese .NET libraries to deploy a stealer targeting browser credentials, crypto wallets, SSH keys, and local files.

Security News
pnpm 11 turns on a 1-day Minimum Release Age and blocks exotic subdeps by default, adding safeguards against fast-moving supply chain attacks.