Type-Safe Environment Variables
A standalone TypeScript implementation of Vite’s loadEnv with type-safe parsing, Docker secrets support, and optional fallback values.
Quick Start
Get up and running with Load Env in three simple steps.
Load environment variables
loadEnv() at the start of your application to load variables from .env files..env.${NODE_ENV}.local, .env.${NODE_ENV}, .env.local, .envExplore Documentation
Learn how to use Load Env effectively in your TypeScript projects.
Loading Env Files
Environment Variables
Docker Secrets
Type Safety
Key Features
Everything you need for robust environment variable management.
Vite-Style Loading
Load environment variables from .env files with the same priority order as Vite
Type-Safe Parsing
Dedicated functions for booleans, dates, numbers, URLs, UUIDs, and enums with automatic validation
Docker Secrets
Load secrets from files for secure Docker and Kubernetes deployments
Optional & Fallbacks
Support for optional variables and default fallback values for flexible configuration
Ready to get started?
Install Load Env and start managing your environment variables with type safety today.
View Quickstart Guide