custom-env
Advanced tools
Comparing version 2.0.0 to 2.0.1
{ | ||
"name": "custom-env", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Custom env is a library built to make development more feasible by allowing multiple .env configurations for different environments.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -100,3 +100,6 @@ # Custom-Env | ||
The `env()` method holds two (2) optional arguments `envname`, `path` which defaults to _dev_ and _current working directory_ respectively. If you wish to set a different path rather than the _current working directory_, pass your path as the second argument of the `env()` method. | ||
The `env()` method holds three (3) optional arguments. | ||
* 1 `envname` - Specifies the development name, defaults to `dev` or `development`, | ||
* 2 `path` - Specifies the directory to find configuration files, defaults to _current working directory_. | ||
* 3 `defaultEnvFallback` - Specifies whether to fallback to `.env` configuration if the specified _envname_ is not found, defaults to `true`. | ||
@@ -107,2 +110,3 @@ ``` | ||
## dotenv-expand | ||
@@ -121,10 +125,3 @@ You can also leverage the [`dotenv-expand`](https://github.com/motdotla/dotenv-expand) extension to use ENV variable expansion inside your `.env` files. | ||
## Chaining | ||
Every public method of custom-env returns itself, making it possible to chain methods. Example: | ||
``` | ||
// Chain the methods | ||
require('custom-env').env('dev').dotenvConfig({'encoding':'utf8'}) | ||
``` | ||
### What about .env.production? | ||
@@ -131,0 +128,0 @@ We strongly recommend that you should not commit and pass `.env.production` file in production mode, as this file may contain sensitive information. |
11225
140