Skip to main content

tiny-typed-env

Typed env. Fail at boot.

Load and validate environment variables with built-in schemas—or Zod, Valibot, and ArkType—across Node, Bun, Deno, and Workers.

import { createEnv, s } from "tiny-typed-env/node"; export const env = createEnv({ DATABASE_URL: s.url(), PORT: s.port({ default: 3000 }), TIMEOUT: s.duration({ default: "30s" }), }); // env.TIMEOUT → 30000

01

Typed & minimal

Built-in s helpers—no Zod required—with full TypeScript inference, nested groups, duration, and bytes.

02

Cross-runtime

Use loadEnv anywhere, or createEnv on Node and Bun with automatic .env loading.

03

Fail-fast + CLI

Invalid env stops the process at boot (secrets redacted). Use npx tiny-typed-env check in CI.