{"id":14155366,"url":"https://github.com/typeofweb-org/schema","last_synced_at":"2025-04-12T04:21:39.030Z","repository":{"id":40928147,"uuid":"328751115","full_name":"typeofweb-org/schema","owner":"typeofweb-org","description":"@typeofweb/schema: Lightweight validator with 100% TypeScript support and sane coercion rules.","archived":false,"fork":false,"pushed_at":"2023-03-05T19:33:00.000Z","size":3403,"stargazers_count":138,"open_issues_count":33,"forks_count":8,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-25T23:51:20.421Z","etag":null,"topics":["functional-programming","hacktoberfest","jsonschema","schema","ts","typescript","validation","validation-library","validations"],"latest_commit_sha":null,"homepage":"https://schema.typeofweb.com","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/typeofweb-org.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":["typeofweb"],"patreon":null,"open_collective":"typeofweb","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2021-01-11T18:08:29.000Z","updated_at":"2024-12-31T08:12:13.000Z","dependencies_parsed_at":"2023-02-06T12:45:39.368Z","dependency_job_id":"32dc475a-99f4-48be-bfad-20e36661eb3b","html_url":"https://github.com/typeofweb-org/schema","commit_stats":{"total_commits":138,"total_committers":6,"mean_commits":23.0,"dds":"0.30434782608695654","last_synced_commit":"c7d5dcd4e133eaf8082dc69c1e2b8a6624bb1eeb"},"previous_names":["typeofweb/schema"],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typeofweb-org%2Fschema","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typeofweb-org%2Fschema/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typeofweb-org%2Fschema/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typeofweb-org%2Fschema/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/typeofweb-org","download_url":"https://codeload.github.com/typeofweb-org/schema/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248514429,"owners_count":21116963,"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":["functional-programming","hacktoberfest","jsonschema","schema","ts","typescript","validation","validation-library","validations"],"created_at":"2024-08-17T08:02:59.069Z","updated_at":"2025-04-12T04:21:38.997Z","avatar_url":"https://github.com/typeofweb-org.png","language":"TypeScript","readme":"# @typeofweb/schema\n\n`@typeofweb/schema` is a lightweight and extensible library for data validation with full TypeScript support!\n\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n[![All Contributors](https://img.shields.io/badge/all_contributors-9-orange.svg?style=flat-square)](#contributors-)\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\n[![codecov](https://codecov.io/gh/typeofweb/schema/branch/main/graph/badge.svg?token=6DNCIHEEUO)](https://codecov.io/gh/typeofweb/schema)\n[![npm](https://img.shields.io/npm/v/@typeofweb/schema.svg)](https://www.npmjs.com/package/@typeofweb/schema)\n[![npm bundle size (minified + gzip)](https://badgen.net/bundlephobia/minzip/@typeofweb/schema)](https://bundlephobia.com/result?p=@typeofweb/schema)\n[![no external dependencies](https://badgen.net/bundlephobia/dependency-count/@typeofweb/schema)](https://bundlephobia.com/result?p=@typeofweb/schema)\n[![tree-shakeable](https://badgen.net/bundlephobia/tree-shaking/@typeofweb/schema)](https://bundlephobia.com/result?p=@typeofweb/schema)\n\n## Docs\n\n### 👉 [schema.typeofweb.com](https://schema.typeofweb.com/) 👈\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://typeofweb.com/\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/1338731?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMichał Miszczyszyn\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/typeofweb/schema/commits?author=mmiszy\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#maintenance-mmiszy\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e \u003ca href=\"#projectManagement-mmiszy\" title=\"Project Management\"\u003e📆\u003c/a\u003e \u003ca href=\"https://github.com/typeofweb/schema/pulls?q=is%3Apr+reviewed-by%3Ammiszy\" title=\"Reviewed Pull Requests\"\u003e👀\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/wisnie\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/47081011?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eBartłomiej Wiśniewski\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/typeofweb/schema/commits?author=wisnie\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/typeofweb/schema/pulls?q=is%3Apr+reviewed-by%3Awisnie\" title=\"Reviewed Pull Requests\"\u003e👀\u003c/a\u003e \u003ca href=\"https://github.com/typeofweb/schema/issues?q=author%3Awisnie\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e \u003ca href=\"https://github.com/typeofweb/schema/commits?author=wisnie\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/AdamSiekierski\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/24841038?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAdam Siekierski\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/typeofweb/schema/pulls?q=is%3Apr+reviewed-by%3AAdamSiekierski\" title=\"Reviewed Pull Requests\"\u003e👀\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/asottile\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/1810591?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAnthony Sottile\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#security-asottile\" title=\"Security\"\u003e🛡️\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://devalchemist.com\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/1423385?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMarek\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/typeofweb/schema/commits?author=malydok\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://www.upwork.com/freelancers/~018e2d48fa8a42e825\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/9992724?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eOlzhas Alexandrov\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/typeofweb/schema/issues?q=author%3Ao-alexandrov\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/Aliath\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/28493823?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eBartek Słysz\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/typeofweb/schema/issues?q=author%3AAliath\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/stepaniukm\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/28492390?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMateusz Stepaniuk\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#ideas-stepaniukm\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/darkowic\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/11510581?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eDariusz Rzepka\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#ideas-darkowic\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n\n## Example\n\n```ts\nimport { number, object, optional, string, validate } from '@typeofweb/schema';\n\nconst personSchema = object({\n  name: string(),\n  age: number(),\n  email: optional(string()),\n})();\n\nconst mark = {\n  name: 'Mark',\n  age: 29,\n};\n\nconst personValidator = validate(personSchema);\n\n// If validation is successful returns data with correct type, throws ValidationError otherwise\nconst validatedPerson = personValidator(mark);\n```\n\n## Early benchmarks\n\nEarly benchmarks show some really promising performance of `@typeofweb/schema` when compared to other industry-leading solutions:\n\n```\nPlatform info:\n==============\n   Darwin 20.3.0 x64\n   Node.JS: 14.16.0\n   V8: 8.4.371.19-node.18\n   Intel(R) Core(TM) i7-6920HQ CPU @ 2.90GHz × 8\n```\n\n| library               | relative speed | operations per second | avg. operation time |\n| --------------------- | -------------: | --------------------: | ------------------: |\n| **@typeofweb/schema** |        **ref** |   **(1,934,098 rps)** |  **(avg: 0.517μs)** |\n| io-ts@2.2.13          |         -7.21% |       (1,794,594 rps) |      (avg: 0.557μs) |\n| mschema@0.5.6         |         -69.8% |         (584,151 rps) |          (avg: 1μs) |\n| validator.js@2.0.4    |        -76.16% |         (461,088 rps) |          (avg: 2μs) |\n| validate.js@0.13.1    |        -89.02% |         (212,408 rps) |          (avg: 4μs) |\n| validatorjs@3.22.1    |         -92.2% |         (150,791 rps) |          (avg: 6μs) |\n| joi@17.3.0            |        -93.25% |         (130,541 rps) |          (avg: 7μs) |\n| superstruct@0.13.3    |        -96.99% |          (58,197 rps) |         (avg: 17μs) |\n| yup@0.32.8            |        -97.09% |          (56,243 rps) |         (avg: 17μs) |\n| parambulator@1.5.2    |        -98.99% |          (19,492 rps) |         (avg: 51μs) |\n| zod@1.11.11           |        -99.03% |          (18,827 rps) |         (avg: 53μs) |\n\n### 👉 [schema.typeofweb.com](https://schema.typeofweb.com/) 👈\n","funding_links":["https://github.com/sponsors/typeofweb","https://opencollective.com/typeofweb"],"categories":["typescript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftypeofweb-org%2Fschema","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftypeofweb-org%2Fschema","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftypeofweb-org%2Fschema/lists"}