Libraries
    Preparing search index...
    • Associates a schema builder with an environment variable name.

      Every leaf field in a config descriptor passed to parseEnv() must be wrapped with env(). This is enforced at the TypeScript level — passing a bare schema builder produces a compile-time error.

      Type Parameters

      • T extends SchemaBuilder<any, any, any, any, any>

      Parameters

      • varName: string

        The environment variable name to read (e.g. 'DB_HOST').

      • schema: T

        A @cleverbrush/schema builder describing the expected type, constraints, coercion, and defaults.

      Returns EnvField<T>

      A branded EnvField descriptor.

      env('DB_PORT', number().coerce().default(5432))