{"id":25013092,"url":"https://github.com/nrjdalal/zod-meta-parser","last_synced_at":"2026-02-23T16:31:24.027Z","repository":{"id":271419042,"uuid":"913375453","full_name":"nrjdalal/zod-meta-parser","owner":"nrjdalal","description":"A utility to extract metadata descriptions from Zod schemas into a structured format.","archived":false,"fork":false,"pushed_at":"2025-01-07T16:09:49.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-29T05:44:59.884Z","etag":null,"topics":["api","conversions","json","meta","parser","schema","zod"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/zod-meta-parser","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/nrjdalal.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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-01-07T15:08:09.000Z","updated_at":"2025-01-07T16:11:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"52ee9502-599b-449b-8422-09de88b178e7","html_url":"https://github.com/nrjdalal/zod-meta-parser","commit_stats":null,"previous_names":["nrjdalal/zod-meta-parser"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nrjdalal/zod-meta-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nrjdalal%2Fzod-meta-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nrjdalal%2Fzod-meta-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nrjdalal%2Fzod-meta-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nrjdalal%2Fzod-meta-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nrjdalal","download_url":"https://codeload.github.com/nrjdalal/zod-meta-parser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nrjdalal%2Fzod-meta-parser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29748180,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T07:44:07.782Z","status":"ssl_error","status_checked_at":"2026-02-23T07:44:07.432Z","response_time":90,"last_error":"SSL_read: 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":["api","conversions","json","meta","parser","schema","zod"],"created_at":"2025-02-05T06:35:21.147Z","updated_at":"2026-02-23T16:31:23.997Z","avatar_url":"https://github.com/nrjdalal.png","language":"TypeScript","funding_links":["https://github.com/sponsors/nrjdalal"],"categories":[],"sub_categories":[],"readme":"# Zod Meta Parser\n\n[![NPM Version](https://img.shields.io/npm/v/zod-meta-parser.svg)](https://npmjs.org/package/zod-meta-parser)\n[![NPM Downloads](https://img.shields.io/npm/dw/zod-meta-parser.svg)](https://npmjs.org/package/zod-meta-parser)\n\n## Summary\n\n`zod-meta-parser` is a utility that extracts metadata descriptions from [Zod schemas](https://github.com/colinhacks/zod) into a structured format. This is particularly useful for generating documentation or for other meta-programming purposes.\n\n## Usage\n\n### Basic Example\n\n```typescript\nimport { z } from \"zod\"\nimport { zodMetaParser } from \"zod-meta-parser\"\n\nconst schema = z.object({\n  id: z.number(), // no description\n  email: z.string().describe(JSON.stringify({ unique: true })),\n  image: z\n    .string()\n    .optional()\n    .describe(JSON.stringify({ s3: true })),\n  createdAt: z.date().describe(\"Read-only field\"),\n}),\n\nconsole.log(zodMetaParser(schema))\n```\n\n#### Expected Output\n\n```json\n{\n  \"email\": {\n    \"_meta\": {\n      \"unique\": true\n    }\n  },\n  \"image\": {\n    \"_meta\": {\n      \"s3\": true\n    }\n  },\n  \"createdAt\": {\n    \"_meta\": \"Read-only field\"\n  }\n}\n```\n\n## Installation\n\nYou can install the package via npm:\n\n```sh\nnpm install zod-meta-parser\n```\n\nor via bun (recommended):\n\n```sh\nbun add zod-meta-parser\n```\n\n## Features\n\n- Extracts metadata descriptions from Zod schemas.\n- Supports nested objects and various Zod types.\n- Provides a structured output format for easy consumption.\n\n## Options\n\nThe `zodMetaParser` function currently does not accept any additional options. All metadata extraction is done based on the structure and descriptions provided in the Zod schema.\n\n## Known Issues\n\n- The `zodToJsonSchema` library used internally might not handle all Zod types perfectly, such as `symbol`. Custom handling is added for types not supported natively.\n- Ensure all fields you want metadata for are described using the `.describe()` method in Zod.\n\n## Versioning\n\nThis package follows semantic versioning. New features and bug fixes will be released as minor or patch updates, while breaking changes will be released as major updates.\n\n\u003c!--\n## Changelog\n\nFor a detailed list of changes, please refer to the [changelog](https://github.com/nrjdalal/zod-meta-parser/blob/master/changelog.md).\n--\u003e\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request on [GitHub](https://github.com/nrjdalal/zod-meta-parser).\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/nrjdalal/zod-meta-parser/blob/master/LICENSE) file for details.\n\n## Sponsors\n\nIf you enjoy this package, consider sponsoring the project on my [GitHub Sponsors page](https://github.com/sponsors/nrjdalal). Your support is greatly appreciated!\n\n---\n\nFeel free to adjust the links and other details as per your project specifics.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnrjdalal%2Fzod-meta-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnrjdalal%2Fzod-meta-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnrjdalal%2Fzod-meta-parser/lists"}