{"id":21703587,"url":"https://github.com/codemonument/deno_zod_semver","last_synced_at":"2026-04-09T16:08:03.853Z","repository":{"id":157172552,"uuid":"633345029","full_name":"codemonument/deno_zod_semver","owner":"codemonument","description":"A simple deno module by @codemonument with a zod schema for validating semver. Uses official regex and is cross-posted to npm as zod-semver","archived":false,"fork":false,"pushed_at":"2024-03-31T22:50:15.000Z","size":88,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-25T15:41:25.090Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/codemonument.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"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}},"created_at":"2023-04-27T09:49:48.000Z","updated_at":"2023-04-27T09:49:54.000Z","dependencies_parsed_at":"2024-11-25T21:44:00.159Z","dependency_job_id":null,"html_url":"https://github.com/codemonument/deno_zod_semver","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":"codemonument/deno_module_template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemonument%2Fdeno_zod_semver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemonument%2Fdeno_zod_semver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemonument%2Fdeno_zod_semver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemonument%2Fdeno_zod_semver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codemonument","download_url":"https://codeload.github.com/codemonument/deno_zod_semver/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244656473,"owners_count":20488638,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-25T21:33:41.779Z","updated_at":"2026-04-09T16:08:03.819Z","avatar_url":"https://github.com/codemonument.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zod SemVer\n\n[![JSR](https://jsr.io/badges/@codemonument/zod-semver)](https://jsr.io/@codemonument/zod-semver/)\n[![NPM Version](https://img.shields.io/npm/v/zod-semver?style=flat\u0026logo=npm\u0026color=CB3435)\n](https://www.npmjs.com/package/zod-semver)\n\nA simple deno module by @codemonument with a zod schema for validating semver.\nUses official regex.\n\n\u003e [!WARNING]\n\u003e Not published to ~~[deno.land/x/zod_semver](https://deno.land/x/zod_semver)~~ anymore! Use the jsr package instead:  \n\u003e `jsr:@codemonument/zod-semver`!\n\n## Usage\n\n### Import in Deno\n\n```bash\ndeno add @codemonument/zod-semver\n```\n\n```ts\nimport {ZodSemver} from '@codemonument/zod-semver';\n```\n\n### Import in Node\n\n```bash\nnpm add @codemonument/zod-semver\n```\n\n```ts\nimport {ZodSemver} from 'zod-semver';\n```\n\n### Usage after Import\n\n```ts\n// Use like any other Zod Schema:\nZodSemver.parse('1.0.0');\n\n// Or include in another Zod Schema like this:\n\nconst MyObjectSchema = z.object({\n\tversion: ZodSemver,\n\tname: z.string(),\n\tage: z.number().optional(),\n});\n```\n\n## Using the branded ZodSemver type\n\nAt it's base, the ZodSemver type is simply a more refined string. So the TS type for it is string.\nHowever, sometimes it might be useful for a function to make sure that it only receives an already parsed semver string.\nThis is possible via the branded `ZodSemver` type.\n\n'branded' means that the type is a string, but with a special property atached that makes it unique.\nSee the zod docs for more information: \u003chttps://zod.dev/?id=brand\u003e\n\n## Links\n\n| Name     | Target                                          |\n| -------- | ----------------------------------------------- |\n| Git Repo | https://github.com/codemonument/deno_zod_semver |\n| JSR      | https://jsr.io/@codemonument/zod-semver/        |\n| NPM      | https://www.npmjs.com/package/zod-semver        |\n\n## Create new version of this package (for maintainers)\n\n1. Update CHANGELOG.md with your changes\n2. Run `deno task uv \u003cnewVersion\u003e`\n3. Run `deno task test`\n4. Commit changes \u0026 add git tag for your version\n5. Push changes \u0026 tags =\u003e github actions will deploy\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodemonument%2Fdeno_zod_semver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodemonument%2Fdeno_zod_semver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodemonument%2Fdeno_zod_semver/lists"}