Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dotenv-load

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dotenv-load - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

index.d.ts

2

cli.js

@@ -6,2 +6,2 @@ #!/usr/bin/env node

const result = shell.exec(process.argv.slice(2).join(' '));
process.exit(result.code)
process.exit(result.code);

@@ -32,15 +32,16 @@ const path = require('path');

const files = [];
if(preloadEnv) {
if (preloadEnv) {
files.push(`${dotenvPath}.${preloadEnv}`);
}
return files.concat(dotenvFiles).forEach(dotenvFile => {
return files.concat(dotenvFiles).forEach((dotenvFile) => {
if (fs.existsSync(dotenvFile)) {
require('dotenv-expand')(
require('dotenv').config({
const dotenv = require('dotenv');
const dotenvExpand = require('dotenv-expand');
dotenvExpand.expand(
dotenv.config({
path: dotenvFile,
})
}),
);
}
})
});
};
{
"name": "dotenv-load",
"version": "2.0.0",
"version": "2.0.1",
"description": "Load environment variables from .env, .env.local, .env.production, etc. when running a npm or yarn command",

@@ -18,2 +18,3 @@ "author": "Martin Rädlinger",

"main": "index.js",
"types": "index.d.ts",
"bin": {

@@ -26,9 +27,9 @@ "dotenv-load": "cli.js"

"dependencies": {
"dotenv": "^5.0.0",
"dotenv-expand": "^4.2.0",
"shelljs": "^0.8.1"
"dotenv": "^16.0.0",
"dotenv-expand": "^8.0.2",
"shelljs": "^0.8.5"
},
"devDependencies": {
"prettier": "^1.11.1"
"prettier": "^2.6.0"
}
}

@@ -37,3 +37,3 @@ # dotenv-load [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

```
```txt
.env.local

@@ -53,1 +53,12 @@ .env.development.local

- `.env.development.local`, `.env.test.local`, `.env.production.local` - Local overrides of environment-specific settings.
## How can I use custom env file?
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:
```js
dotenvLoad() # will initialize standard names
dotenvLoad('default') # will initialize your `.env.default` (while not overwriting defined vars above)
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc