Closed PatrickJS closed 6 years ago
Yo! I could definitely see this being useful, but I think converting automatically would be a bit too magical (since environment variables are expected to be strings), and it could be a breaking change for people relying on the current behavior. I'd be fine with exposing it as an option though for custom loading -- something like:
import {load as envkeyLoad} from 'envkey/loader'
envkeyLoad({ parseBooleans: true })
It might also be cool to allow parsing numbers, dates, or even JSON objects/arrays like this.
yeah that would be awesome as a flag 👍
yo, we also manage some basic configuration in envkey like urls depending on the env or even booleans. Is there a way for envkey to parse these boolean keys so we won't have to write the code
String(process.env.DISABLE_TRACKING) === 'true'
or at least a way to hook intoapplyVarsToEnv
so we can run the check ourselfI ended up doing this