
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.
env-docker-node
Advanced tools
Utility to get node.js environment variable or environment variable file. To support the Docker VAR / VAR_FILE definition
This is a utility package to extract environment variables in Node.js, taking into account the possibility for ENV_FILE type variables as is used a lot in Docker containers.
By default the _FILE variant will be preferred. This means if a file is set, it will try to load it before falling back on the environment variable as is. This behavior can be altered by setting the PreferType as shown below.
const envFile = require('env-docker-node');
envFile.setPreferType(envFile.PreferTypes.ENV); // the PreferType is envFile.PreferTypes.FILE by default
process.env.HELLO_FILE = '/some/file';
process.env.HELLO = 'world';
console.log(envFile('HELLO', 'default'));
// output will be world, since the environment variable as is is now preferred
const envFile = require('env-docker-node');
console.log(envFile('HELLO', 'default'));
// output 'default'
process.env.HELLO_FILE = '/some/file';
console.log(envFile('HELLO', 'default'));
// output is the content of '/some/file'
process.env.HELLO = 'world';
console.log(envFile('HELLO', 'default'));
// output 'world'
FAQs
Utility to get node.js environment variable or environment variable file. To support the Docker VAR / VAR_FILE definition
We found that env-docker-node 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.