dotenv-mono
Advanced tools
Comparing version 1.2.0 to 1.3.0
{ | ||
"name": "dotenv-mono", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"main": "./dist/index.js", | ||
@@ -9,2 +9,11 @@ "module": "./dist/index.js", | ||
"author": "Marco Cesarato <cesarato.developer@gmail.com>", | ||
"exports": { | ||
".": { | ||
"default": "./dist/index.js", | ||
"require": "./dist/index.js", | ||
"types": "./dist/index.d.ts" | ||
}, | ||
"./load": "./dist/load.js", | ||
"./package.json": "./package.json" | ||
}, | ||
"files": [ | ||
@@ -11,0 +20,0 @@ "dist" |
@@ -249,2 +249,26 @@ <div align="center"> | ||
### Preload | ||
As on the [dotenv](https://github.com/motdotla/dotenv) package, you can use the `--require` (`-r`) [command line option](https://nodejs.org/api/cli.html#-r---require-module) to preload dotenv. By doing this, you do not need to require and load dotenv in your application code. | ||
```bash | ||
$ node -r dotenv-mono/load your_script.js | ||
``` | ||
The configuration options below are supported as command line arguments in the format `dotenv_config_<option>=value` | ||
```bash | ||
$ node -r dotenv-mono/load your_script.js dotenv_config_path=/custom/path/to/.env dotenv_config_debug=true | ||
``` | ||
Additionally, you can use environment variables to set configuration options. Command line arguments will precede these. | ||
```bash | ||
$ DOTENV_CONFIG_<OPTION>=value node -r dotenv-mono/load your_script.js | ||
``` | ||
```bash | ||
$ DOTENV_CONFIG_ENCODING=latin1 DOTENV_CONFIG_DEBUG=true node -r dotenv-mono/load your_script.js dotenv_config_path=/custom/path/to/.env | ||
``` | ||
## 💡 Methods | ||
@@ -251,0 +275,0 @@ |
56630
14
793
339