Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
plurals-cldr
Advanced tools
Key benefits:
cardinal
and ordinal
forms support.node.js:
$ npm install plurals-cldr
Returns form name for given number. Number can be passed as string to keep
tailing decimal zeros. If locale not supported, returns null
.
var plural = require('plural-cldr');
// Get cardinal form name
//
// Params:
//
// - locale
// - number (Number|String)
//
plural('ru', 0) // -> 'many'
plural('ru', 1) // -> 'one'
plural('ru', 2) // -> 'few'
plural('ru', 19) // -> 'many'
plural('ru', 0.5) // -> 'other'
Returns array of available forms for specified locale. If locale not supported,
returns null
.
Returns index of form for specified locale. That's convenient, if you wish to implement lookup from compact ordered list, like babelfish does.
If locale not supported, function returns -1
.
Order of forms is the same for all languages: zero
, one
, two
, few
,
many
, other
. Remove unavailable forms, and you will get indexes of each.
The same as above, but for ordinal forms.
You need to bump cldr-core
version & run rebuild:
npm install cldr-core@latest --save-dev
rm package-lock.json
rm -rf node_modules
npm install
npm run build
FAQs
Plurals support, generated from CLDR.
The npm package plurals-cldr receives a total of 39,409 weekly downloads. As such, plurals-cldr popularity was classified as popular.
We found that plurals-cldr 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.