createEnvLookup
createEnvLookup(
source?):EnvLookup
Defined in: create-env-lookup.ts:23
Create a lightweight env lookup backed by a fixed source dict or, when
called with no arguments, by a lazy read of process.env on every call.
Use the no-arg form for the application singleton — it always reflects the
current state of process.env so tests can mutate it freely:
Parameters
Section titled “Parameters”source?
Section titled “source?”Record<string, string | undefined>
Returns
Section titled “Returns”Example
Section titled “Example”// singleton — reads process.env lazilyexport const env = createEnvLookup();
// injectable — tests pass a fake dictexport function makeEnv(source?: Record<string, string | undefined>) { return createEnvLookup(source);}