envsecurepro is a lightweight, developer-friendly CLI tool for Node.js projects that helps you validate, guard, and manage environment variables.
It ensures your .env files are correct, type-safe, and follow best practices — without relying on third-party dependencies like dotenv.
Perfect for developers who want reliable, maintainable, and error-free environment configurations in their Node.js apps.
Environment variables are critical for configuration, but mistakes can cause runtime errors, security issues, or unexpected behavior.
envsecurepro prevents this by:
- ✅ Validating required variables and their types
- ⚡ Enforcing schema rules (enum, boolean, number, string)
- 📄 Generating
.env.exampleautomatically - 🛠️ Giving clear CLI feedback (warnings or errors)
- 🔒 Supporting strict mode for production
Catch mistakes early and keep your projects safe & stable.
- ✅ Validation: Detect missing, invalid, or incorrect environment variables
⚠️ Warning & Strict Modes: Flexible validation for dev & production- 📄 Generate
.env.example: Auto-generate examples with defaults & docs - 💻 CLI Commands: Run
lintandgeneratedirectly from your terminal or CI/CD - 🔧 Custom Schema: Define types, defaults, and descriptions per project
- 🪶 Zero Dependencies: Pure Node.js implementation, no dotenv required
Install globally:
npm install -g envsecureproOr run with npx (no install needed):
npx envsecurepro <command>envsecurepro lintChecks your .env against schema.js and reports warnings/errors.
envsecurepro generateCreates a .env.example from your schema — useful for documentation and onboarding.
Define your schema in schema.js:
module.exports = {
PORT: {
type: "number",
required: true,
default: 3000,
description: "Port the server will run on"
},
NODE_ENV: {
type: "enum",
values: ["development", "production", "test"],
required: true,
description: "Application environment"
},
DEBUG: {
type: "boolean",
default: false,
description: "Enable debug mode"
}
};- Warn Mode (default): Logs warnings but doesn’t stop execution
- Strict Mode: Exits process on invalid or missing variables (use in production)
Pull requests and feature requests are welcome! Feel free to open an issue if you find a bug or have an idea.
MIT © 2025