{"id":19389247,"url":"https://github.com/polioan/zod-env","last_synced_at":"2026-05-15T11:15:45.465Z","repository":{"id":205082700,"uuid":"713374119","full_name":"polioan/zod-env","owner":"polioan","description":"Parsing .env using Zod","archived":false,"fork":false,"pushed_at":"2023-11-02T12:07:21.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-18T11:24:31.327Z","etag":null,"topics":["dotenv","env","zod"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@polioan/zod-env","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/polioan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"polioan","custom":["https://boosty.to/polioan"]}},"created_at":"2023-11-02T11:48:02.000Z","updated_at":"2023-11-02T12:08:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"6fc0c9a5-2f02-4010-8cbf-7695efe81eea","html_url":"https://github.com/polioan/zod-env","commit_stats":null,"previous_names":["polioan/zod-env"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/polioan/zod-env","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polioan%2Fzod-env","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polioan%2Fzod-env/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polioan%2Fzod-env/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polioan%2Fzod-env/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/polioan","download_url":"https://codeload.github.com/polioan/zod-env/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polioan%2Fzod-env/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33064665,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-15T02:00:06.351Z","response_time":103,"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":["dotenv","env","zod"],"created_at":"2024-11-10T10:15:42.876Z","updated_at":"2026-05-15T11:15:45.460Z","avatar_url":"https://github.com/polioan.png","language":"TypeScript","funding_links":["https://github.com/sponsors/polioan","https://boosty.to/polioan"],"categories":[],"sub_categories":[],"readme":"# zod-env\n\n[![version](https://img.shields.io/npm/v/@polioan/zod-env.svg)](https://www.npmjs.com/package/@polioan/zod-env)\n[![license](https://img.shields.io/github/license/polioan/zod-env)](https://opensource.org/licenses/MIT)\n\n## Install\n\n### npm\n\n```shell\nnpm i @polioan/zod-env\n```\n\n### yarn\n\n```shell\nyarn add @polioan/zod-env\n```\n\n## Usage\n\n### Normal\n\n```ts\nimport { defineEnvSchema } from '@polioan/zod-env'\nimport { z } from 'zod'\n\nconst env = defineEnvSchema({\n  schema: z.object({ NODE_ENV: z.enum(['production', 'development']) }),\n})\n\nconst value = env('NODE_ENV') // \"production\" | \"development\"\nconst unknownValue = env('FOO') // string | undefined\n```\n\n### In bundler environment\n\n```ts\nimport { defineEnvSchema } from '@polioan/zod-env'\nimport { z } from 'zod'\n\nconst env = defineEnvSchema({\n  schema: z.object({ NODE_ENV: z.enum(['production', 'development']) }),\n  values: {\n    NODE_ENV: process.env.NODE_ENV,\n  },\n})\n\nconst value = env('NODE_ENV') // \"production\" | \"development\"\nconst unknownValue = env('FOO') // string | undefined\n```\n\n### With Deno or other \"non process.env\"\n\n```ts\nconst env = defineEnvSchema({\n  schema: z.object({ NODE_ENV: z.enum(['production', 'development']) }),\n  envResolver: {\n    getFallback() {\n      return Deno.env.toObject()\n    },\n    get(key) {\n      return Deno.env.get(key)\n    },\n  },\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolioan%2Fzod-env","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolioan%2Fzod-env","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolioan%2Fzod-env/lists"}