Type-safe environment variable validation library (v1.5.0) that follows the Standard Schema specification, making it compatible with validation libraries like Zod, Valibot, and Arktype. It parses and validates environment variables from process.env, providing clear error messages and TypeScript type inference. Published as an ES-only package with npm release cadence; differentiates by plugging into the Standard Schema ecosystem, allowing reuse of existing schemas and tooling (e.g., TypeBox, Effect/Schema via adapters).
npm install envaseNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to use env() with a Zod schema to parse and validate environment variables, with defaults and type inference.
Use z.coerce.number(), z.coerce.boolean() or transform from string.
Wrap in try/catch or use parseEnv() which returns Result type.
Ensure standard-schema dependency is at version 1.x.
Use ESM imports (import) or ensure package.json type: module.
Use named import: import { env } from 'envase';