
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.
Read the environment variables in the specified configuration file and set them to the current application, and run the specified script.
读取指定配置文件中的环境变量并设置到当前应用程序中,并运行指定的脚本。
很多时候,在开发机上的配置我们不需要同步到git上,以前设置环境变量是设置到package.json,但这个文件不会加入到.gitignore,有一些机密设置会一不小心就同步到网上。
该项目将变量设置项存储于指定的配置文件中,你可以将该文件加入到.gitignore中,避免被同步到网上。
npm install --save env-loador
在package.json的scripts中添加配置项,如:
{
"name": "demo",
"version": "0.0.1",
"description": "",
"main": "lib/index.js",
"scripts": {
"dev": "env-loador node index.js"
},
"keywords": [],
"author": "",
"license": "ISC"
}
只有一个参数--file,通过该参数可以设置环境变量配置所在的位置。如:env-loador --file ./.env node index.js,默认情况下,变量存储于./env.json文件中。
参考文件env.json
FAQs
Read the environment variables in the specified configuration file and set them to the current application, and run the specified script.
We found that env-loador 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.