
Security News
NIST Officially Stops Enriching Most CVEs as Vulnerability Volume Skyrockets
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.
reverse-config
Advanced tools
Reverse npm package config environment variables into an object.
$ npm install reverse-config
npm functionality instead of homegrown configuration formats and parsers~/.npmrcEssentially, this package is just syntactic sugar for reading
npm_package_config_* properties from process.env.
var reverseConfig = require('reverse-config');
reverseConfig.get({string} [key])
key is undefined, the entire configuration object is returnedkey is alphanumeric, it is used as property accessor for the configuration object.get('@my.scoped/package') would try to access
.my.scoped.message in the configuration objectThe npm transformation of the package.json config object
to environment variables is a destructive process.
Given either
{
"config": {
"foo": [
42
]
}
}
or
{
"config": {
"foo": {
"0": 42
}
}
}
or
{
"config": {
"foo_0": "42"
}
}
the resulting environment variable name is npm_package_config_foo_0,
and its value the string '42'.
Rule of thumb: only use alphanumeric property names.
The useful exception would be package names used as config sections, e.g.
{
"config": {
"my_package": {},
"@my.scope/my-package": {},
}
}
Use with moderation and pretend to be a responsible adult.
During reversion values are coerced with good faith as follows:
In other words, you might face surprises if you use strings like "42", "true", "false" or "null" as property values in your package.json config object. Don't do that then!.
MIT
FAQs
Reverse npm package config environment variables into an object.
We found that reverse-config 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
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.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.