Feature: Return env as Object
Opened this issue · 0 comments
Story
As a person wanting to know which which environment variables were in the .env
file
I would like to have the environment variables that were in the .env
file returned as an Object
So that I can check if the var was loaded from a file or from another place.
Currently in our usage instructions: https://github.com/dwyl/env2#use-in-your-code
We hint at the possibility that the environment variables loaded by env2
are assigned to the env
constant:
const env = require('env2')('./path-to-your/.env');
But reading the code
we can see that no such Object
is being returned:
Lines 57 to 60 in 15a8bd4
We could return the env
on line 38 and it would (before the catch
statement):
Lines 32 to 38 in 15a8bd4
This would not alter the existing functionality of the package and would add this feature.