Convenience wrapper for simple flat configs where each key is both the config property name and the environment variable name.
Equivalent to calling parseEnv() with every entry wrapped in env().
parseEnv()
env()
A record mapping env var names to schema builders.
Optional
The environment variable source. Defaults to process.env.
process.env
const config = parseEnvFlat({ DB_HOST: string().default('localhost'), DB_PORT: number().coerce().default(5432), JWT_SECRET: string().minLength(32),});// Type: { DB_HOST: string, DB_PORT: number, JWT_SECRET: string } Copy
const config = parseEnvFlat({ DB_HOST: string().default('localhost'), DB_PORT: number().coerce().default(5432), JWT_SECRET: string().minLength(32),});// Type: { DB_HOST: string, DB_PORT: number, JWT_SECRET: string }
Convenience wrapper for simple flat configs where each key is both the config property name and the environment variable name.
Equivalent to calling
parseEnv()with every entry wrapped inenv().