@zedtech/zedkit-server
Fail fast on bad environment variables
Parse env with a zod shape and throw one readable error at boot.
beta
Usage
At a glance
- Who: Node service authors who want typed
process.envwithout Nest. - What: Parse env with a zod shape and throw one readable error at boot.
- Use when: Standalone workers, scripts, and services that do not use the Nest config hook.
- Avoid when: Inside Nest apps — use the nest package env validation instead.
- See also: Bootstrap a Nest app
Install
pnpm add @zedtech/zedkit-serverLatest: 0.1.2 (via changesets).
Example
import { loadEnv } from "@zedtech/zedkit-server";
import { z } from "zod";
const env = loadEnv({ PORT: z.coerce.number(), DATABASE_URL: z.string().url() });Wraps: zod