env-options.js 633 B

123456789101112131415161718192021222324
  1. // ../config.js accepts options via environment variables
  2. const options = {}
  3. if (process.env.DOTENV_CONFIG_ENCODING != null) {
  4. options.encoding = process.env.DOTENV_CONFIG_ENCODING
  5. }
  6. if (process.env.DOTENV_CONFIG_PATH != null) {
  7. options.path = process.env.DOTENV_CONFIG_PATH
  8. }
  9. if (process.env.DOTENV_CONFIG_DEBUG != null) {
  10. options.debug = process.env.DOTENV_CONFIG_DEBUG
  11. }
  12. if (process.env.DOTENV_CONFIG_OVERRIDE != null) {
  13. options.override = process.env.DOTENV_CONFIG_OVERRIDE
  14. }
  15. if (process.env.DOTENV_CONFIG_DOTENV_KEY != null) {
  16. options.DOTENV_KEY = process.env.DOTENV_CONFIG_DOTENV_KEY
  17. }
  18. module.exports = options