Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
babel-plugin-inline-dotenv
Advanced tools
Load your `.env` file and replace `process.env.MY_VARIABLE` with the value you set.
Load your .env
file and replace process.env.MY_VARIABLE
with the value you set.
tl;dr
It actually replaces process.env.MY_VARIABLE
with:
process && process.env && process.env.MY_VARIABLE || 'value assigned to variable in dotenv'
This way, if the value is available at runtime it will be used instead.
$ npm install babel-plugin-inline-dotenv
.babelrc
(Recommended)Without options:
.babelrc
{
"plugins": ["inline-dotenv"]
}
With options:
{
"plugins": [["inline-dotenv",{
path: 'path/to/.env' // See motdotla/dotenv for more options
}]]
}
To replace with env value without process && process.env && process.env.MY_VARIABLE ||
safety:
{
"plugins": [["inline-dotenv",{
unsafe: true
}]]
}
The plugin support 3 mode to read the env var from the system :
{
"plugins": [["inline-dotenv",{
systemVar: 'all' | 'overwrite' | 'disable'
}]]
}
all
default, every env var found in process.env will be used
⚠️ This could leak super secret stuffs !
overwrite
, the value in process.env will overwrite the one present in .env only. Your .env file act as a whitelist
disable
, the process.env will not be used at all
$ babel --plugins inline-dotenv script.js
require("babel-core").transform("code", {
plugins: ["inline-dotenv"]
});
FAQs
Load your `.env` file and replace `process.env.MY_VARIABLE` with the value you set.
The npm package babel-plugin-inline-dotenv receives a total of 35,357 weekly downloads. As such, babel-plugin-inline-dotenv popularity was classified as popular.
We found that babel-plugin-inline-dotenv 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.