Release Mar 28, 2026 5 min read

Announcing @fotros/env v1.0 — Type-Safe Environment Variables

Parse and validate environment variables at startup with full TypeScript inference. No more process.env string casting — your env is typed, validated, and documented.

@fotros/env v1.0 is now stable. It parses and validates process.env at startup, gives you fully typed access to every variable, and fails fast with a clear error message when something is missing or malformed.

Quick Start

typescript
1
import { createEnv } from '@fotros/env';
 
3
export const env = createEnv({
4
  DATABASE_URL: String,
5
  PORT: Number.default(3000),
6
  NODE_ENV: ['development', 'production', 'test'] as const,
7
  API_KEY: String.min(32),
8
});
 
10
// env.PORT is number — not string
11
// env.NODE_ENV is 'development' | 'production' | 'test'
Tags
TypeScriptnpmReleaseDX
// RELATED POSTS

You might also like