Config files that tsc understands.

Import app.config.yaml and get the merged, environment-specific object with a type inferred from the file itself. Environment files are checked against the base, and mistakes point at the line in the YAML.

npm i tyfigo
  1. app.config.yamlbase
    server:
      host: localhost
      port: ${PORT:-3000}
    features: [search]
  2. app.production.config.yamlNODE_ENV=production
    server:
      host: 0.0.0.0
    features: [search, billing]
  3. .envvalues only
    PORT=8080
import config from './app.config.yaml';

config.server.port  // 8080, typed number
config.server.host  // '0.0.0.0', typed string
config.features     // readonly string[]

Checked when you type-check

A TypeScript 7.1 content mapper turns each config file into a type. Unknown keys, wrong types in an environment file and syntax errors are reported by tsc at their line in the config file.

Validated when it loads

Placeholders such as ${DATABASE_URL} resolve from .env files and the real environment. Add a Zod, Valibot, ArkType or Effect schema with loadConfig for refinements, with every problem listed by file and line.

Runs where your code runs