
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.
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
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.