envsaurus
Version:
ENVSAURUS is a zero-dependency CLI + library that turns your .env.example into a fully typed config file. It validates environment variables at runtime, fails fast in CI, and exports a safe CONFIG object for Node/TypeScript apps. Catch missing or invalid
7 lines (6 loc) • 494 B
TypeScript
export declare function asNumber(x: string | undefined, key?: string): number;
export declare function asBoolean(x: string | undefined): boolean;
export declare function asEnum<T extends string>(x: string | undefined, key: string, opts: readonly T[]): T;
export declare function asURL(x: string | undefined, key?: string): string;
export declare function asEmail(x: string | undefined, key?: string): string;
export declare function asJSON<T = unknown>(x: string | undefined, key?: string): T;