Skip to content
forked from keawade/zod-env

Utility for validating environment variables with Zod in a Deno environment.

License

Notifications You must be signed in to change notification settings

clouedoc/zod-env

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@keawade/zod-env

This module provides lightweight tooling for parsing environment variables in Deno with Zod schemas while respecting Deno's permissions tooling to make environment variable usage clear.

Permissions are requested individually for each environment variable specified in the provided schema. Permissions can be rejected without failure as long as the schema defines that variable as optional or provides a default value.

Use

deno add jsr:@keawade/zod-env
import { parseEnv } from "jsr:@keawade/zod-env";

const envSchema = z.object({
  FOO: z.string(),
  PORT: z.coerce.number().default("8080"),
  BAR: z.string().optional(),
});

const parsedEnv = parseEnv();

About

Utility for validating environment variables with Zod in a Deno environment.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%