You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great if we could leverage our .env.example file to set and configure validators, since it's a common practive in developer teams to have this kind of file in projects.
The idea is to pass a config to cleanEnv function to load specs from the file path we pass to it or defaulting to .env.example and parse it as JSON, like this:
Hi, thanks for the idea! Since v7 though the goal is really to keep this a small and focused library, as much as possible. Envalid can be used in the browser so we need to keep it lean. You should definitely consider starting a separate wrapper library that parses that JSON format and turns it into a cleanEnv call– I just think that scope doesn't fit the core envalid project
It would be great if we could leverage our
.env.example
file to set and configure validators, since it's a common practive in developer teams to have this kind of file in projects.The idea is to pass a config to
cleanEnv
function to load specs from the file path we pass to it or defaulting to.env.example
and parse it as JSON, like this:The cleanEnv function must handle if we pass specs and useExampleFile, merging it or just use one or another.
I've already forked this project and I'm working on this feature. When ready and well tested, I will make a pull request to review.
The text was updated successfully, but these errors were encountered: