Replies: 1 comment 4 replies
-
|
@djfo this is a great suggestion. Thanks @djfo. Others have mentioned this as well. It's something we will try to work on soon. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everybody,
this is the first time I use the Discussions feature and also the first time I'm trying to participate in the development of the
dotenvpackage.I have a suggestion related to the interface/API of the package.
The package exports the functions
parseandconfig, whereparseparses the contents of a.envfile andconfigupdatesprocess.envbased on the key-value pairs read from the.envfile.Since
configis implemented usingparse, I hoped to also find a function that parses the.envfile (taking a configuration as an argument likeconfig) and returns aDotenvParseOutput, without updatingprocess.env. Or alternatively, a function that loads the contents of.env(according to the configuration) and returns a string or buffer (essentially something that can be passed toparsein turn).However, there is no such function.
I suggest to add this function, maybe named
load, with the same interface asconfig, but not updatingprocess.env:It is easily implemented in code using the
dotenvpackage, but I think it would make a nice addition to the package.Rationale: I expect that a simple call to
configis the main use case for this package. However, sometimes side-effect-free loading of.env(in the sense of only loading the key-value pairs without updating the environment) may be desirable.Please let me know if such a change is welcome, I'd be happy to open a corresponding PR if so.
Beta Was this translation helpful? Give feedback.
All reactions