
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Utilities for working with LC environment variables.
npm install cli-locale
npm test
var lc = require('cli-locale')('en_us');
var lang = lc.find(['LC_ALL', 'LC_MESSAGES']);
Suppose you load files based on the language identifier and prefer using hyphens to underscores, you can pass a filter function:
var lc = require('cli-locale')('en_us');
var lang = lc.find(['LC_ALL', 'LC_MESSAGES'], function(lang) {
return lang.replace(/_/g, '-');
});
You could also use this functionality to convert between language identifiers or to take action on an unsupported language.
Find the value of an LC environment variable and return a sanitized represention of the locale. If no variable value is found in the search array then this method returns the first available LC variable. If no LC variables are available in the environment this method returns the default language.
search: Array of LC environment variables to prefer.filter: A filter function.Return a language identifier.
The rules for locating a language identifier are:
language.language.LANG, if the value of LANG is C return the
default language.A language identifier to use when no value could be extracted via the environment, default value is en.
Sanitize the value of an LC variable removing any character encoding portion, such that en_GB.UTF-8 becomes en_gb.
lang: A language identifier extracted from an LC environment variable.filter: A filter function.strict: Return null rather than the default language en when no language could be extracted from the environment.Returns a sanitized language identifier.
FAQs
Utilities for working with LC environment variables
We found that cli-locale 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.