@chatopera/dotenv
Advanced tools
Comparing version 5.1.0 to 5.1.1
{ | ||
"name": "@chatopera/dotenv", | ||
"version": "5.1.0", | ||
"version": "5.1.1", | ||
"description": "Expand environment variables using dotenv", | ||
@@ -13,8 +13,8 @@ "main": "lib/main.js", | ||
"type": "git", | ||
"url": "https://github.com/motdotla/dotenv-expand" | ||
"url": "https://github.com/samurais/dotenv-expand" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/motdotla/dotenv-expand/issues" | ||
"url": "https://github.com/samurais/dotenv-expand/issues" | ||
}, | ||
"author": "Scott Motte <mot@mot.la> (http://mot.la)", | ||
"author": "Scott Motte <mot@mot.la> (http://mot.la), Hai Liang Wang <hain@chatopera.com> (https://www.chatopera.com)", | ||
"keywords": [ | ||
@@ -21,0 +21,0 @@ "dotenv", |
@@ -17,4 +17,3 @@ # dotenv-expand | ||
```bash | ||
npm install dotenv --save | ||
npm install dotenv-expand --save | ||
npm install @chatopera/dotenv --save | ||
``` | ||
@@ -24,11 +23,15 @@ | ||
Define vars in .env | ||
``` | ||
OTHER_ENV=foo | ||
YOUR_ENV_VAR=$OTHER_ENV/bar | ||
``` | ||
As early as possible in your application, require dotenv and dotenv-expand, and | ||
wrap dotenv-expand around dotenv. | ||
wrap dotenv expand around dotenv. | ||
```js | ||
var dotenv = require('dotenv') | ||
var dotenvExpand = require('dotenv-expand') | ||
var myEnv = dotenv.config() | ||
dotenvExpand(myEnv) | ||
require('@chatopera/dotenv').config(process.cwd() + '/.env') | ||
process.env["YOUR_ENV_VAR"] | ||
``` | ||
@@ -35,0 +38,0 @@ |
5120
40