
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
process-env.json
Advanced tools
Tiny, Simple library to load config.json file into the process.env object.
npm i process-env.json
//config.json
{
"VALUE": "AWESOME"
}
//index.js
require('process-env.json')();
console.log(process.env.VALUE);
//custom-process-env.json
{
"VALUE": "AWESOME"
}
//index.js
//pass file name. relative paths work
require('process-env.json')('custom-process-env.json');
console.log(process.env.VALUE);
//pm2.json
{
"apps": [
{
"name": "app1",
"script": "index.js",
"cwd": "./app1",
"exec_mode": "cluster",
"watch": true,
"env": {
"PORT":"3333",
"MONGO_DB":"mongodb://127.0.0.1:27017/db"
}
},
{
"name": "app2",
"script": "index.js",
"cwd": "./app2",
"exec_mode": "cluster",
"watch": true,
"env": {
"PORT":"3444",
"MONGO_DB":"mongodb://127.0.0.1:27017/app"
}
}
]
}
//index.js
//pass file name
require('process-env.json')('pm2.json');
console.log(process.env.MONGO);
Note: for pm2 file with multiple apps. There is a secord argument you can supply on the require.
//index.js
//(filename, appIndex)
require('process-env.json')('pm2.json', 1);
console.log(process.env.MONGO);
Why would I need this if I have pm2 or nodemon? Well... if you have to a pm2 or nodemon server but also need to run cli scripts, this would be perfect for you. This library allows to you use your pm2 or nodemon file and load it into the process.env for cli scripts. Helpful, right?
//nodemon.json
{
"restartable": "r",
"ignore": [
"node_modules/"
],
"verbose": true,
"watch": [
"./"
],
"env":{
"MONGO":"mongodb://127.0.0.1:27017",
"PORT":"3401",
},
"ext": "js json"
}
//index.js
require('process-env.json')('nodemon.json');
console.log(process.env.MONGO);
For situations where you have mutliple envs and need to switch you env values, you can supply --config_file={env}.json and process-env.json will add that as the filename without you having to change your code.
//qa.json
{
"FOO": "BAR"
}
//staging.json
{
"FOO": "BAZ"
}
//index.js
require('process-env.json')('nodemon.json');
console.log(process.env.FOO);
node index.js --config_test=qa.json
//logs BAR
node index.js --config_test=staging.json
//logs BAZ
FAQs
Tiny library to load json file into process.env.
We found that process-env.json 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.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.