
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.
auto load .env file if it exist, allow json format, plain env string, and with easier accessible method without using process.env
You may be coding in local, use yourself mysql , mongodb, etc. But in deploy server, the mysql,mongodb's username and password is different. Usually, username and password pass into program through environment. So, this package can auto switch env, if you have a .env file in root of project
.env file to your project in root path, write env data use json format in it.env to .gitignore file to ignore it.env file to run projectYeah, you don't to change any code
my project
.env, now only support json format. allow recursive, join with _
{
"MONGODB": "localhost",
"MONGO": {
"USER": "root",
"Port": 27017
}
}
or
# in this format, two kind of comment is supported
# one is prefix line with `#`
// the other is prefix line with `//`
MONGODB = localhost
MONGO_USER = root
MONGO_Port = 27017
in json format, all value would be save as String even if it's a Number. Such as
typeof MONGO_PORTreturnString.
default, all env name will be save as upper case. You can set
autoTransformCaseas false to turn off this.
index.js - find .env file under __dirname which pass to it. Or it's' default is process.cwd()
require('env-deploy')(__dirname);
console.log(process.env.MONGODB);
console.log(process.env.MONGO_USER);
console.log(process.env.MONGO_PORT);
.gitignore
.env
run with with .env file
localhost
root
27017
in deploy server without .env file, but have environment like MONGODB=111.111.111.111 MONGO_USER=data
111.111.111.111
data
27017
thanks for your usage, welcome you to pull request to me.
suggest used in mac os or linux
[x] support key=value format
FAQs
auto load .env file if it exist, allow json format, plain env string, and with easier accessible method without using process.env
We found that env-deploy 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.