
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
dotenv-load
Advanced tools
Load environment variables from .env, .env.local, .env.production, etc. when running a npm or yarn command
Load environment variables from .env
, .env.local
, .env.production
, etc. when running a npm or yarn command.
This dotenv loading behaviour was extracted from create-react-app to be
also usable with non create-react-app
projects like next.js or any other node
specific project.
dotenv-load
can be used in an yarn/npm command:
{
"scripts": {
"dev": "dotenv-load node server.js",
"build": "NODE_ENV=production dotenv-load node server.js"
}
}
dotenv-load
can be used in an yarn/npm command:
const dotenvLoad = require('dotenv-load');
dotenvLoad();
.local
filesadd .local
files to .gitignore
.env.local
.env.development.local
.env.production.local
dotenv-load
will load the following files, starting from the bottom.
The first value set (or those already defined in the environment) take precedence:
.env
- The Original®.env.local
- Local overrides. This file is loaded for all environments except test
..env.development
, .env.test
, .env.production
- Environment-specific settings..env.development.local
, .env.test.local
, .env.production.local
- Local overrides of environment-specific settings.You can pass a string to dotenvLoad
function, but your file should have a name like .env.YOUR_CUSTOM_NAME
, for example: .env.default
.
Then you can initialize it as follows:
dotenvLoad() # will initialize standard names
dotenvLoad('default') # will initialize your `.env.default` (while not overwriting defined vars above)
FAQs
Load environment variables from .env, .env.local, .env.production, etc. when running a npm or yarn command
We found that dotenv-load 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
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.