Developer releases envault, a zero-dependency TypeScript env variable validator
A developer named Gavin Cettolo has released envault, an open-source Node.js library that validates, coerces, and types environment variables at application startup. The tool addresses a common vulnerability where missing or malformed environment variables go undetected until a runtime error surfaces deep in the application. Unlike using dotenv with Zod, envault has zero runtime dependencies and provides full TypeScript type inference, meaning variables like PORT are typed as number rather than string or undefined. Version 0.2.0 introduces array type support, per-environment enforcement via requiredIn, and a custom validate option for user-defined logic. The package also includes secret masking and auto-generation of a .env.example file, and is available via npm or pnpm.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in