Skip to content

dotenv_config_path as environment variable itself [feature request] #351

@damianobarbati

Description

@damianobarbati

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions