dotenv icon indicating copy to clipboard operation
dotenv copied to clipboard

Variable expansion (reference) should work without an additional package

Open MiguelMike opened this issue 3 years ago • 2 comments

Let's assume we have an .env file:

FIRST_NAME="Joe"
SURNAME="Doe"
FULL_NAME="${FIRST_NAME} ${SURNAME}"

After this file is sourced $FULL_NAME would automatically have the referenced variables filled. That's what one would expect more often than not. This is not the case when using dotenv. To achieve this an additional package dotenv-expand is required.

It would make much more sense if dotenv expanded referenced variables by default. A config option {expand: false} might be used to change this behavior. Am I missing something?

MiguelMike avatar Nov 05 '22 20:11 MiguelMike

You have a good point. Will consider this.

motdotla avatar May 04 '23 21:05 motdotla

can I work on this @motdotla?

deepam-kapur avatar May 05 '23 21:05 deepam-kapur