Having to pass dotenv_config_path as process argument yields some downside:
- argv is polluted with it so the application has to handle this additional logic (filtering it out from args)
- concatenating command in a npm/yarn script may be messy in some cases when your command expects a second dynamic part (you have to deal with dotenv_config_path everywhere)
Is it possible to pass dotenv_config_path as an env variable itself?
Instead of:
$ node -r esm -r dotenv/config index.js dotenv_config_path=config/development.env
having:
$ DOTENV=config/development.env node -r esm -r dotenv/config index.js