releases·2026-06-01·2 min read

v1.0.0 — Type-Safe Environment Variables for TypeScript

Initial release of CtroEnv: define, validate, and infer types for environment variables with zero runtime dependencies.

Ctrotech·
release
Featured image for v1.0.0 — Type-Safe Environment Variables for TypeScript
RSS Feed

v1.0.0 — Type-Safe Environment Variables for TypeScript

CtroEnv v1.0.0 is live — a TypeScript-first environment variable management toolkit with zero runtime dependencies.

What is CtroEnv?

Define, validate, and infer types for environment variables. 4 KB gzipped, zero dependencies, full TypeScript inference, no code generation step.

Why Another Env Library?

Existing solutions have tradeoffs:

  • dotenv: Loads .env files but provides no validation or type safety
  • t3-env: Great pattern but requires Zod (50 KB+ dependency)
  • envalid: Solid but lacks TypeScript-native inference

CtroEnv is built from scratch with zero dependencies, native TypeScript inference, and errors grouped by category with actionable suggestions.

What's Included

PackageDescription
@ctroenv/coreSchema engine with validators and type inference
@ctroenv/sharedInternal shared utilities
@ctroenv/cliCLI tooling (validate, generate, check, docs, init)
@ctroenv/nodeNode.js .env file loading
@ctroenv/viteVite build-time validation plugin
@ctroenv/nextjsNext.js client/server env splitting

Example

import { defineEnv, string, number, pick } from "@ctroenv/core"

const env = defineEnv({
  DATABASE_URL: string().url(),
  PORT: number().port().default(3000),
  NODE_ENV: pick(["dev", "staging", "prod"]),
  JWT_SECRET: string().min(32).secret(),
})

Get Started

npm install @ctroenv/core

Documentation: ctroenv.vercel.app GitHub: github.com/ctrotech-tutor/ctroenv

More releases posts
Previous postv1.0.1 — Polish & Developer Experience

On this page

What is CtroEnv?Why Another Env Library?What's IncludedExampleGet Started