{"id":28922152,"url":"https://github.com/fontebasso/envguardr","last_synced_at":"2026-06-29T01:00:38.990Z","repository":{"id":292542083,"uuid":"981227589","full_name":"fontebasso/envguardr","owner":"fontebasso","description":"Catch broken env vars before your app starts — fail-fast CLI with strict schema validation.","archived":false,"fork":false,"pushed_at":"2026-06-28T04:58:23.000Z","size":242,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-06-28T05:13:54.395Z","etag":null,"topics":["ci","cli","devops","dotenv","env","environment-variables","fail-fast","schema","typescript","validation"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fontebasso.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-10T16:17:00.000Z","updated_at":"2026-06-28T04:37:04.000Z","dependencies_parsed_at":"2025-05-10T16:39:27.627Z","dependency_job_id":"00f476a6-5a63-46ba-ae75-b98c858a454a","html_url":"https://github.com/fontebasso/envguardr","commit_stats":null,"previous_names":["fontebasso/envguardr"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/fontebasso/envguardr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fontebasso%2Fenvguardr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fontebasso%2Fenvguardr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fontebasso%2Fenvguardr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fontebasso%2Fenvguardr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fontebasso","download_url":"https://codeload.github.com/fontebasso/envguardr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fontebasso%2Fenvguardr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34909138,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-28T02:00:05.809Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["ci","cli","devops","dotenv","env","environment-variables","fail-fast","schema","typescript","validation"],"created_at":"2025-06-22T07:38:18.423Z","updated_at":"2026-06-29T01:00:38.983Z","avatar_url":"https://github.com/fontebasso.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"assets/logo-envguardr.png\" alt=\"envguardr\" width=\"256\" /\u003e\n\n[![tests](https://github.com/fontebasso/envguardr/actions/workflows/tests.yml/badge.svg)](https://github.com/fontebasso/envguardr/actions/workflows/tests.yml)\n[![npm](https://img.shields.io/npm/v/envguardr)](https://www.npmjs.com/package/envguardr)\n[![downloads](https://img.shields.io/npm/dw/envguardr)](https://www.npmjs.com/package/envguardr)\n[![size](https://img.shields.io/npm/unpacked-size/envguardr)](https://www.npmjs.com/package/envguardr)\n[![license](https://img.shields.io/npm/l/envguardr)](LICENSE)\n\n**Catch broken env vars before your app starts.**\n\n```bash\nnpx envguardr validate ./env.schema.js\n```\n\n```\n❌ API_URL is required\n❌ PORT must be a valid number\n✅ All environment variables are valid.\n```\n\nExits with code `1` on failure — drop it into any CI pipeline and ship with confidence.\n\n---\n\n## Install\n\n```bash\nnpm install --save-dev envguardr\n```\n\n## Schema\n\n```js\n// env.schema.js\nimport { validators } from 'valitype';\n\nexport default {\n  API_URL:      { type: 'url',    required: true },\n  PORT:         { type: 'number', default: 3000 },\n  NODE_ENV:     { type: { enum: ['development', 'production', 'test'] }, default: 'development' },\n  DEBUG:        { type: 'boolean', default: false },\n  API_KEY: {\n    type: 'custom',\n    validator: validators.regex(/^[A-Za-z0-9]{32}$/, 'Must be 32 alphanumeric characters'),\n    required: true,\n  },\n}\n```\n\n## CI/CD\n\n```yaml\n- name: Validate environment\n  run: npx envguardr validate ./env.schema.js\n```\n\nOr as an npm script:\n\n```json\n\"scripts\": {\n  \"check-env\": \"envguardr validate ./env.schema.js\"\n}\n```\n\n## Node.js support\n\n`envguardr` supports the following Node.js versions:\n\n| Node.js | Status    |\n| ------- | --------- |\n| 20      | Supported |\n| 22      | Supported |\n| 24      | Supported |\n\nThe test suite runs against all supported Node.js versions to ensure compatibility across the supported runtime matrix.\n\n## Types\n\n| Type | Accepts | Notes |\n|---|---|---|\n| `string` | Any string | |\n| `number` | `\"3000\"` | Decimal only — rejects `0xff`, `1e5` |\n| `boolean` | `\"true\"` / `\"false\"` | Strict — no `1`, `yes`, `on` |\n| `url` | `\"https://...\"` | Requires `http` or `https` |\n| `{ enum: string[] }` | One of the listed values | |\n| `custom` | — | Bring your own logic |\n\nAll types accept `required?: boolean` and `default?: T`.\n\n## Built-in validators\n\n```ts\nvalidators.regex(/^[A-Z]{3}$/, 'Must be 3 uppercase letters')\nvalidators.range(1, 65535, 'Must be a valid port')\nvalidators.oneOf(['us-east-1', 'eu-west-1'], 'Unsupported region')\nvalidators.date('YYYY-MM-DD', 'Invalid date format')\nvalidators.json('Must be valid JSON')\nvalidators.awsArn('lambda', 'Must be a valid Lambda ARN')\nvalidators.all(validators.regex(/^[A-Z]/), validators.oneOf(['Alpha', 'Beta']))\n```\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md).\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffontebasso%2Fenvguardr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffontebasso%2Fenvguardr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffontebasso%2Fenvguardr/lists"}