Skip to content

Commit

Permalink
fix: missing config.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeti-or committed Feb 3, 2022
1 parent 76d0676 commit 9442a00
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,26 +131,26 @@ See [CHANGELOG.md](CHANGELOG.md)

### Preload

You can use the `--require` (`-r`) [command line option](https://nodejs.org/api/cli.html#cli_r_require_module) to preload dotenv & dotenv-extend. By doing this, you do not need to require and load dotenv or dotenv-extend in your application code. This is the preferred approach when using `import` instead of `require`.
You can use the `--require` (`-r`) [command line option](https://nodejs.org/api/cli.html#cli_r_require_module) to preload dotenv & dotenv-expand. By doing this, you do not need to require and load dotenv or dotenv-expand in your application code. This is the preferred approach when using `import` instead of `require`.

```bash
$ node -r dotenv-extend/config your_script.js
$ node -r dotenv-expand/config your_script.js
```

The configuration options below are supported as command line arguments in the format `dotenv_config_<option>=value`

```bash
$ node -r dotenv-extend/config your_script.js dotenv_config_path=/custom/path/to/your/env/vars
$ node -r dotenv-expand/config your_script.js dotenv_config_path=/custom/path/to/your/env/vars
```

Additionally, you can use environment variables to set configuration options. Command line arguments will precede these.

```bash
$ DOTENV_CONFIG_<OPTION>=value node -r dotenv-extend/config your_script.js
$ DOTENV_CONFIG_<OPTION>=value node -r dotenv-expand/config your_script.js
```

```bash
$ DOTENV_CONFIG_ENCODING=latin1 node -r dotenv-extend/config your_script.js dotenv_config_path=/custom/path/to/.env
$ DOTENV_CONFIG_ENCODING=latin1 node -r dotenv-expand/config your_script.js dotenv_config_path=/custom/path/to/.env
```

## Who's using dotenv-expand?
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"types": "./lib/main.d.ts",
"default": "./lib/main.js"
},
"./config": "./config.js",
"./config.js": "./config.js",
"./package.json": "./package.json"
},
"scripts": {
Expand Down

0 comments on commit 9442a00

Please sign in to comment.