toddbluhm / env-cmd

Setting environment variables from a file
https://www.npmjs.com/package/env-cmd
MIT License
1.73k stars 65 forks source link

[Feature Request] Possibility to reference existing variables #330

Open kkuriata opened 2 years ago

kkuriata commented 2 years ago

Possibility to use existing variables:

GENERIC_PATH=/some/path
SPECIFIC_PATH_1=${GENERIC_PATH}/specific1
SPECIFIC_PATH_2=${GENERIC_PATH}/specific2
JamersonAguiarOSF commented 1 year ago

Any updates about this?

motdotla commented 6 months ago

you can use dotenvx for this

HELLO="World"
HELLO2=$HELLO
// index.js
console.log(`Hello ${process.env.HELLO}`)
console.log(`Hello ${process.env.HELLO2}`)
dotenvx run -- node index.js