fast-env-guard
v1.0.0
Published
Fast, zero-dependency environment variable validator and type caster with strict schema enforcement and clear error reporting.
Maintainers
Readme
🛡️ fast-env-guard
Fast, zero-dependency environment variable validator and type caster with strict schema enforcement and clear error reporting.
🚀 Quick Start
import { defineEnv } from 'fast-env-guard';
export const env = defineEnv({
PORT: { type: 'number', default: 3000 },
DATABASE_URL: { type: 'string', required: true },
NODE_ENV: { type: 'string', choices: ['development', 'production', 'test'], default: 'development' },
DEBUG_MODE: { type: 'boolean', default: false },
});
console.log(env.PORT); // typed as number!
console.log(env.DEBUG_MODE); // typed as boolean!💖 Support the Project
If you find this package useful, consider sponsoring its ongoing development: 👉 Sponsor @Piratha97 on GitHub Sponsors
📄 License
MIT © 2026 Pirapaakaran Pirathapan
