{"id":48746951,"url":"https://github.com/marcomuser/conformal","last_synced_at":"2026-04-12T12:13:35.141Z","repository":{"id":311258889,"uuid":"1042681441","full_name":"marcomuser/conformal","owner":"marcomuser","description":"Type-safe form submissions for the modern web.","archived":false,"fork":false,"pushed_at":"2025-10-19T10:08:46.000Z","size":256,"stargazers_count":35,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-16T05:18:55.325Z","etag":null,"topics":["formdata","schema","submission","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/conformal","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/marcomuser.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-08-22T12:02:09.000Z","updated_at":"2026-01-12T10:45:44.000Z","dependencies_parsed_at":"2025-08-23T13:49:22.893Z","dependency_job_id":"f7786e89-fb61-4b51-a4e9-4e385374ce3f","html_url":"https://github.com/marcomuser/conformal","commit_stats":null,"previous_names":["marcomuser/conformal"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/marcomuser/conformal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcomuser%2Fconformal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcomuser%2Fconformal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcomuser%2Fconformal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcomuser%2Fconformal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcomuser","download_url":"https://codeload.github.com/marcomuser/conformal/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcomuser%2Fconformal/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31714307,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-12T06:22:27.080Z","status":"ssl_error","status_checked_at":"2026-04-12T06:21:52.710Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["formdata","schema","submission","typescript"],"created_at":"2026-04-12T12:13:34.543Z","updated_at":"2026-04-12T12:13:35.135Z","avatar_url":"https://github.com/marcomuser.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Conformal\n\n\u003e Type-safe form submissions for the modern web.\n\nConformal helps you work with native [`FormData`](https://developer.mozilla.org/docs/Web/API/FormData). It solves two major pain points:\n\n- ✅ **Strongly typed FormData parsing** – Turn native `FormData` into real objects with full TypeScript inference (nested objects and arrays with dot/bracket notation).\n- ✅ **Canonical submission flow** – A single `Submission` object that preserves raw input, separates field vs. form errors, and standardizes the success/error states.\n\nWorks everywhere: In browsers, Node.js, and edge runtimes with React, Vue, Svelte, or vanilla JavaScript.\n\n### Table of Contents\n\n- [Getting Started](#getting-started)\n- [Live Examples](#live-examples)\n- [API Reference](#api-reference)\n- [License](#license)\n\n## Getting Started\n\nInstall Conformal via npm or the package manager of your choice:\n\n```bash\nnpm install conformal\n```\n\nHere's a quick example showing how Conformal handles form validation with a user registration form:\n\n```typescript\nimport { parseFormData } from \"conformal\";\nimport * as z from \"zod\";\n\n// Tip: Use conformal's coerce functions for form input preprocessing\nconst schema = z.object({\n  name: z.string().min(2, \"Name must be at least 2 characters\"),\n  email: z.email(\"Invalid email address\"),\n  age: z.coerce.number().min(18, \"Must be at least 18 years old\"),\n  acceptTerms: z.coerce.boolean(),\n});\n\n// In your form action or handler\nconst result = parseFormData(schema, formData);\nconst submission = result.submission();\n\nif (submission.status === \"success\") {\n  // submission.value is fully typed: { name: string, email: string, age: number, acceptTerms: boolean }\n  console.log(\"User registered:\", submission.value);\n} else {\n  // submission.fieldErrors contains validation errors: { email: [\"Invalid email address\"] }\n  console.log(\"Validation errors:\", submission.fieldErrors);\n  // submission.input preserves the raw user input for re-display\n  console.log(\"User input:\", submission.input);\n}\n```\n\nThat's it! Conformal automatically handles FormData parsing, type coercion, and provides a clean submission interface.\n\n## Live Examples\n\n- **React** - Form actions with useActionState: [StackBlitz](https://stackblitz.com/github/marcomuser/conformal/tree/main/examples/react?embed=1\u0026theme=dark\u0026preset=node\u0026file=src/Form.tsx) | [Source](https://github.com/marcomuser/conformal/tree/main/examples/react)\n\n- **SvelteKit** - Server-side form actions: [StackBlitz](https://stackblitz.com/github/marcomuser/conformal/tree/main/examples/svelte?embed=1\u0026theme=dark\u0026preset=node\u0026file=src/routes/%2Bpage.server.ts) | [Source](https://github.com/marcomuser/conformal/tree/main/examples/svelte)\n\n## API Reference\n\n### Functions\n\n- **[`parseFormData`](src/README.md#parseformdata)** - Parse FormData with schema validation and get Submission object\n- **[`decode`](src/README.md#decode)** - Convert FormData to structured objects (no validation)\n- **[`serialize`](src/README.md#serialize)** - Transform typed values back to form-compatible strings\n- **[`getPath`](src/README.md#getpath)** - Safely access nested values using dot/bracket notation\n- **[`setPath`](src/README.md#setpath)** - Immutably set nested values using dot/bracket notation\n- **[`coerceX`](src/README.md#coerce-functions)** - A set of coercion functions for use with schema libraries\n\n### Types\n\n- **[`Submission`](src/README.md#submission)** - Standardized submission result with success/error states\n- **[`PathsFromObject`](src/README.md#pathsfromobject)** - Type utility to extract all possible object paths\n\n### Valibot Utilities\n\n\u003e ⚠️ **Experimental**: These utilities are still in development and may change.\n\n- **[Coercion Pipes](src/valibot/README.md#coercion-pipes)** - Pipes for automatic form input preprocessing\n\n## License\n\nConformal is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcomuser%2Fconformal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcomuser%2Fconformal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcomuser%2Fconformal/lists"}