jdn404/envault — reverse-engineered prompt

Reverse engineered prompt

GitHub

Build me a small TypeScript library for validating environment variables in Node apps.

I want developers to define their env schema with one simple function and helpers like string, number, boolean, url, port, email, json, list, uuid, secret, date, phone, semver, ip, hex, and enum. The returned env object should be fully typed so people don’t need casting.

It should load one or more env files, support defaults and optional values, collect all missing or invalid variables before failing, and print clear friendly terminal errors. Secrets should be masked anywhere they’re shown.

Please include useful options like strict mode for unknown variables, custom error handling, environment specific file loading, conditional required variables, and cross field validation. Add a CLI so people can check their env, generate an example file, and inspect what variables are expected.

Keep it zero runtime dependencies if possible, TypeScript ready, Node 18 plus, and make it work cleanly in normal Node apps plus common setups like Next, Vite, and Express.

Want more depth? Deep Reverse