Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dmi3y/dotenv-safe-select
Select dotenv file while development
https://github.com/dmi3y/dotenv-safe-select
Last synced: 5 days ago
JSON representation
Select dotenv file while development
- Host: GitHub
- URL: https://github.com/dmi3y/dotenv-safe-select
- Owner: dmi3y
- Created: 2020-03-16T17:55:24.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-03-26T08:53:38.000Z (over 2 years ago)
- Last Synced: 2024-04-11T15:56:30.952Z (7 months ago)
- Language: JavaScript
- Size: 124 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Select dotenv file safe
> Allows to select dotenv files and run project with checks against predefined set of env variables during development.
During development select any of .env files located into project root and do check current env variables against `.env.example` file with [`dotenv-safe`](https://github.com/rolodato/dotenv-safe).
### Installation
> yarn add dotenv-safe
> yarn add --dev dotenv-safe-select### Usage
- There only one file `.env.example` which needs to be checked in with version control and used as a single source of truth to check for present env variables.
- Create other dotenv files like `.env.local`, `.env.staging`, `.env.production` etc. which are not checked in version control.
- Issue development command for example `yarn dotenv-safe-select -- next dev`.
- Optionally it is possible to pass direct path to dotenv file like so `yarn dotenv-safe-select --path .env.mine -- next dev`.
- Select dotenv file you would like run your development against.
- Profit :palm_tree:
Inspired by [donenv-flow](https://github.com/kerimdzhanov/dotenv-flow#readme).
**Note:** the command passed to dotenv-safe-select executed as a child process spawn. I'm thinking to add child process fork support to be able execute `.js` files.