cloudfoundry-community / node-cfenv

easy access to your Cloud Foundry application environment for node
Apache License 2.0
73 stars 20 forks source link

.env file support ? #44

Closed DivekJohns closed 4 years ago

DivekJohns commented 4 years ago

Hi folks, Any workaround to use .env files for this library?

pmuellr commented 4 years ago

Any workaround to use .env files for this library?

You'll need to provide more context. Not sure how or when you would expect a .env file to be used. For local testing?

DivekJohns commented 4 years ago

Any workaround to use .env files for this library?

You'll need to provide more context. Not sure how or when you would expect a .env file to be used. For local testing?

Problem: I have many environments [local, stage, production] It is very challenging to connect to these environments to debug locally, we end up hardcoding values, so thought of maintaining multiple .env files for different environments and load according to NODE_ENV. I came to know vcapfile can be used for this purpose, any option I could pass .env or vcapfile, which could just work like dotenv lib to solve multiple dependencies,