Use an objects own property, or an environment variable. Optionally treat as a boolean if the env should be set to 1 or 0.
ownOrEnv(object, field, env, boolean)
object[field] if it's an own property, otherwise use the
named environent variable. If
boolean is set to
true, then cast
to a boolean flag.
// will set doTheThing to true based on config.doThing, falling back// to reading process.env.DO_THING, where '0' is treated as false.var doTheThing =// just treat this one as a string, not a boolean flagvar file =