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
The way we have our envalid declarations set up at work is to put them by category in different files in a directory, then load the whole directory, merging all declarations, then passing the result through cleanEnv and making it immutable.
After #44 we can drop our immutable proxy wrapper, but we still need our own code to load all en variables. What do you think about adding that capability directly to envalid?
'use strict';const{ bool }=require('envalid');module.exports={SECURE_COOKIES: bool({desc: 'Enable to set `Secure` flag on all cookies',default: true,devDefault: false,}),};
You can provide multiple directories, or single files of these, and they are merged.
handling of dupes are undefined (in practice last one wins, but you should avoid overlap). That can be defined, though, if you want that.
The text was updated successfully, but these errors were encountered:
That looks like a nice way of organizing your env config. At work we still have things in a single file and it's getting a bit unwieldy. I'm in favor of adding this as long as it's not adding a ton of complexity, and that the fs calls can be worked around for those using envalid from RN.
The way we have our envalid declarations set up at work is to put them by category in different files in a directory, then load the whole directory, merging all declarations, then passing the result through
cleanEnv
and making it immutable.After #44 we can drop our immutable proxy wrapper, but we still need our own code to load all en variables. What do you think about adding that capability directly to envalid?
Example:
Each file is e.g
security.js
You can provide multiple directories, or single files of these, and they are merged.
handling of dupes are undefined (in practice last one wins, but you should avoid overlap). That can be defined, though, if you want that.
The text was updated successfully, but these errors were encountered: