zedkit
@zedtech/zedkit-server

Fail fast on bad environment variables

Parse env with a zod shape and throw one readable error at boot.

beta

At a glance

  • Who: Node service authors who want typed process.env without 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-server

Latest: 0.1.2 (via changesets).

Example

Usage
import { loadEnv } from "@zedtech/zedkit-server";
import { z } from "zod";
const env = loadEnv({ PORT: z.coerce.number(), DATABASE_URL: z.string().url() });

Wraps: zod

On this page