OOrveth

Documentation

Config

@orveth/config — strict environment-backed configuration parsing.

@orveth/config parses environment variables with strict coercions. Invalid values fail at startup instead of silently becoming NaN or wrong defaults.

config.ts
import {
  coercedInteger,
  parseConfig,
  createProcessEnvSource,
} from "@orveth/config";

// PORT=8080abc throws during parse — not a valid integer
const config = parseConfig(
  {
    PORT: coercedInteger("PORT"),
  },
  createProcessEnvSource(),
);