@rtorcato/api-config v1.0.0
Interfaces
LoadEnvOptions
Defined in: index.ts:7
Properties
path?
optionalpath?:string
Defined in: index.ts:12
Path to the .env file to load. Defaults to .env in the current working
directory (.env.test when NODE_ENV === 'test').
skipDotenv?
optionalskipDotenv?:boolean
Defined in: index.ts:14
Skip reading a .env file and validate process.env as-is.
Functions
loadEnv()
loadEnv<
T>(schema,options?):output<T>
Defined in: index.ts:26
Load environment variables from a .env file and validate them against schema.
Throws an Error with the formatted field errors on validation failure — it
deliberately does NOT call process.exit, so the host application decides how
to react.
Type Parameters
T
T extends ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>
Parameters
schema
T
options?
LoadEnvOptions = {}
Returns
output<T>
the parsed, typed environment.