{"id":29954961,"url":"https://github.com/arshtiwari2004/envguard","last_synced_at":"2026-03-11T01:01:36.088Z","repository":{"id":304773065,"uuid":"980781311","full_name":"ArshTiwari2004/envguard","owner":"ArshTiwari2004","description":"A zero-config, framework-agnostic NPM package that validates and documents your environment variables from your .env.example file, preventing runtime errors before they happen.","archived":false,"fork":false,"pushed_at":"2025-06-08T01:39:11.000Z","size":1103,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-07T13:05:35.775Z","etag":null,"topics":["acertinityui","dotenv","fs-extra","jest-tests","nextjs","npm","npm-cli","npm-package","yargs"],"latest_commit_sha":null,"homepage":"https://envguard.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArshTiwari2004.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-09T17:49:08.000Z","updated_at":"2025-07-13T04:45:11.000Z","dependencies_parsed_at":"2025-07-15T10:05:12.362Z","dependency_job_id":"d5183d10-f09b-4600-b019-cc975a340a1f","html_url":"https://github.com/ArshTiwari2004/envguard","commit_stats":null,"previous_names":["arshtiwari2004/envguard"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ArshTiwari2004/envguard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArshTiwari2004%2Fenvguard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArshTiwari2004%2Fenvguard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArshTiwari2004%2Fenvguard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArshTiwari2004%2Fenvguard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArshTiwari2004","download_url":"https://codeload.github.com/ArshTiwari2004/envguard/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArshTiwari2004%2Fenvguard/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30364599,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T21:41:54.280Z","status":"ssl_error","status_checked_at":"2026-03-10T21:40:59.357Z","response_time":106,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["acertinityui","dotenv","fs-extra","jest-tests","nextjs","npm","npm-cli","npm-package","yargs"],"created_at":"2025-08-03T17:07:56.567Z","updated_at":"2026-03-11T01:01:36.002Z","avatar_url":"https://github.com/ArshTiwari2004.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"envguard.png\" alt=\"EnvGuard Logo\" width=\"600\"/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cb\u003eA zero-config, framework-agnostic NPM package and UI for validating and documenting your environment variables, straight from your \u003ccode\u003e.env.example\u003c/code\u003e file.\u003c/b\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@arishtiwari/envguard\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/@arshtiwari/envguard?style=for-the-badge\" alt=\"NPM Version\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@arishtiwari/envguard\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/dt/@arshtiwari/envguard?style=for-the-badge\" alt=\"Downloads\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/ArshTiwari2004/envguard/stargazers\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/stars/ArshTiwari2004/envguard?style=for-the-badge\" alt=\"GitHub Stars\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/ArshTiwari2004/envguard/blob/main/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/ArshTiwari2004/envguard?style=for-the-badge\" alt=\"License\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/ArshTiwari2004/envguard/actions\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/ArshTiwari2004/envguard/ci.yml?style=for-the-badge\" alt=\"CI Status\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n## Quick Start\n\n\n### Install via NPM\n\n\n```bash\nnpm install @arshtiwari/envguard\n```\n\n### Add to Project Startup\n\n```bash\nrequire('envguard'); // Validates env vars on startup\n```\n\n### Or Use CLI\n\n```bash\nnpx envguard validate\n```\n\n\n\n## Features\n\n-  **Zero-config** - Works with existing `.env.example`\n-  **Framework-agnostic** - Node.js, Next.js, React, Vue, etc.\n-  **Auto-documentation** - Keep `.env.example` always updated\n-  **Interactive UI** - Visual debugger for environment variables\n-  **Validation** - Catch missing/invalid vars before runtime\n-  **Multiple Integration Methods** - CLI, programmatic, and React UI\n\n---\n\n\n# 🧰 Tech Stack\n\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg height=\"40\" src=\"https://skillicons.dev/icons?i=ts,nodejs,react,tailwind,vite,jest,git,github,figma\" alt=\"Tech Stack\"\u003e\n\u003c/div\u003e\n\n--\n\n\n\n| Category        | Technologies                               |\n|----------------|--------------------------------------------|\n| Backend/Core    | TypeScript, Node.js                        |\n| Schema Validation | Zod, Custom Schema Generator              |\n| File Parsing    | dotenv, fs-extra                          |\n| CLI             | yargs, commander                          |\n| Frontend (UI)   | React.js, Vite , TailwindCSS      |\n| Testing         | Jest                                      |\n| CI/CD           | GitHub Actions                            |\n\n\n\n\n\n\n\n## Installation and setup\n\n### 1. Install\n\n```bash\nnpm install --save-dev @arshtiwari/envguard\n# or\nyarn add -D @arshtiwari/envguard\n# or\npnpm add -D @arshtiwari/envguard\n```\n### 2. Validate in CLI\n\n```bash\nnpx envguard validate\n```\n\n\n### 3. Use Programmatically\n\n```bash\nconst { runEnvguard } = require('envguard');\nif (!runEnvguard()) {\nprocess.exit(1);\n}\n```\n\n### 4. Access frontend\n\n```bash\ncd ui\nnpm install\nnpm run dev\n```\n\nVisit [http://localhost:5173](http://localhost:5173) to view the UI.\n\n---\n\n## Folder Structure\n\n```bash\n\nenvguard/\n├── .env.example                # Example env file for validation\n├── .gitignore\n├── README.md                   # Project documentation\n├── package.json\n├── babel.config.js             # Babel config for transpiling (if needed)\n├── jest.config.js              # Jest config for tests\n├── tsconfig.json               # TypeScript config (optional)\n├── LICENSE\n├── dist/                       # Transpiled output for npm (ignored in VCS)\n│   └── ...                     # Compiled JS files\n├── src/                        # Main source code\n│   ├── index.js                # Main entry point (exports runEnvguard)\n│   ├── parser/\n│   │   └── envExampleParser.js\n│   ├── schema/\n│   │   └── schemaGenerator.js\n│   ├── validator/\n│   │   └── validator.js\n│   ├── reporter/\n│   │   └── errorReporter.js\n│   ├── cli/\n│   │   └── cli.js              # CLI entry point\n│   ├── utils/\n│   │   └── helpers.js\n│   └── types/\n│       └── index.d.ts          # Type definitions\n├── server/                     # Backend server for live UI (optional)\n│   └── server.js\n├── scripts/                    # Utility scripts (e.g., generate .env.example)\n│   └── generateEnvExample.js\n├── tests/                      # Jest test files\n│   ├── parser.test.js\n│   ├── schema.test.js\n│   ├── validator.test.js\n│   └── cli.test.js\n├── ui/                         # React UI dashboard (dev/optional)\n│   ├── src/\n│   │   ├── App.jsx\n│   │   ├── main.jsx\n│   │   ├── index.css\n│   │   └── components/\n│   │       └── EnvTable.jsx\n│   ├── public/\n│   │   ├── index.html\n│   │   └── env-vars.json       # (for demo, replaced by API in prod)\n│   ├── tailwind.config.js\n│   └── vite.config.js\n├── website/                    # Landing page (for npm promotion)\n│   ├── src/\n│   │   ├── App.jsx\n│   │   ├── main.jsx\n│   │   └── components/\n│   │       ├── Hero.jsx\n│   │       └── Pricing.jsx\n│   ├── public/\n│   │   └── index.html\n│   ├── tailwind.config.js\n│   └── vite.config.js\n\n```\n\n\n---\n\n## How It Works\n\n1. **Parse** your `.env.example` for variable names and defaults.\n2. **Generate** a validation schema automatically.\n3. **Validate** your actual environment (`process.env`) against the schema.\n4. **Report** errors in CLI, programmatically, or visually in the UI.\n\n---\n\n\n\n## File Structure Example\n\n```bash\nproject-root/\n├── .env                # Local environment (gitignored)\n├── .env.example        # Template with all required vars\n├── .env.development    # Environment-specific vars\n├── .env.production\n└── package.json\n```\n\n#### Your .env.example should look like:\n\n```bash\n# Required variables\nAPI_KEY=your_api_key_here\nDATABASE_URL=postgres://user:pass@localhost:5432/db\n\n# Optional variables\n# PORT=3000\n# DEBUG=false\n```\n\n## Advanced Configuration\n\n#### Create envguard.config.js for custom rules:\n\n```bash\nmodule.exports = {\n  // Custom schema rules\n  rules: {\n    API_KEY: {\n      minLength: 32,\n      pattern: /^sk_[a-zA-Z0-9]+$/\n    }\n  },\n  \n  // Additional environments\n  environments: ['staging', 'test'],\n  \n  // Custom error messages\n  messages: {\n    missing: '🚨 Missing required env var: {var}',\n    invalid: '❌ Invalid value for {var}: {error}'\n  }\n};\n```\n\n\n\n\n\n\n\n\n## Contributing\n\nPull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.\n\n---\n\n## License\n\nMIT © Arsh Tiwari\n\n\n---\n\n## 📬 Contact\n\nHave questions or need help? Feel free to reach out!\n\n- **Email:** [arshtiwari12345@gmail.com](mailto:arshtiwari12345@gmail.com)\n- **GitHub:** [@ArshTiwari2004](https://github.com/ArshTiwari2004)\n- **Twitter/X:** [@ArshTiwari17](https://x.com/ArshTiwari17)\n- **LinkedIn:** [Arsh Tiwari](https://www.linkedin.com/in/arsh-tiwari-072609284/)\n\nFor bug reports or feature requests, please [open an issue](https://github.com/ArshTiwari2004/envguard/issues) on GitHub.\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003ci\u003e Happy coding! May your environment variables always be valid. ✨\u003c/i\u003e\n\u003c/p\u003e\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farshtiwari2004%2Fenvguard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farshtiwari2004%2Fenvguard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farshtiwari2004%2Fenvguard/lists"}