{"id":19904419,"url":"https://github.com/alloc/zod-file","last_synced_at":"2025-05-03T00:31:38.757Z","repository":{"id":107079089,"uuid":"591494279","full_name":"alloc/zod-file","owner":"alloc","description":null,"archived":true,"fork":false,"pushed_at":"2023-01-20T22:35:06.000Z","size":19,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T21:02:34.588Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alloc.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}},"created_at":"2023-01-20T22:29:59.000Z","updated_at":"2024-11-11T16:55:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"12710b44-6b85-46b0-8d15-5781c5bd5058","html_url":"https://github.com/alloc/zod-file","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alloc%2Fzod-file","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alloc%2Fzod-file/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alloc%2Fzod-file/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alloc%2Fzod-file/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alloc","download_url":"https://codeload.github.com/alloc/zod-file/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252126560,"owners_count":21698964,"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-12T20:28:20.605Z","updated_at":"2025-05-03T00:31:38.750Z","avatar_url":"https://github.com/alloc.png","language":"TypeScript","funding_links":["https://paypal.me/alecdotbiz"],"categories":[],"sub_categories":[],"readme":"# zod-file\n\n[![npm](https://img.shields.io/npm/v/zod-file.svg)](https://www.npmjs.com/package/zod-file)\n[![Code style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://paypal.me/alecdotbiz)\n\n\u003e Binary and base64 validators\n\n\u0026nbsp;\n\n### Usage\n\nExtend `zod` with a custom module, like `src/zod.ts` in your project:\n\n```ts\nexport * from 'zod'\nexport * from 'zod-file'\n```\n\nUse it in your schema:\n\n```ts\nimport * as z from './zod'\n\nconst User = z.object({\n  avatar: z.base64(),\n})\n\nconst parsedUser = User.parse({\n  // Pass a buffer or a base64 string.\n  avatar: fs.readFileSync('avatar.png'),\n})\n\n// Receive a base64 string.\nconst base64Avatar = parsedUser.avatar\n\n// Invalid base64 strings will throw.\nUser.parse({\n  avatar: 'not base64',\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falloc%2Fzod-file","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falloc%2Fzod-file","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falloc%2Fzod-file/lists"}