{"id":15046998,"url":"https://github.com/ahungrynoob/jsonschema","last_synced_at":"2025-06-21T05:06:45.366Z","repository":{"id":36974863,"uuid":"421393601","full_name":"ahungrynoob/jsonschema","owner":"ahungrynoob","description":"A node package based on jsonschema-rs for performing JSON schema validation","archived":false,"fork":false,"pushed_at":"2023-03-06T05:01:17.000Z","size":532,"stargazers_count":51,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-11T20:58:10.255Z","etag":null,"topics":["json-schema","napi-rs","nodejs","rust"],"latest_commit_sha":null,"homepage":"","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/ahungrynoob.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2021-10-26T11:18:36.000Z","updated_at":"2024-04-10T20:55:33.000Z","dependencies_parsed_at":"2024-10-19T20:51:25.985Z","dependency_job_id":"1b1a3d6e-3ed9-426b-ac7e-6d10a678dacf","html_url":"https://github.com/ahungrynoob/jsonschema","commit_stats":{"total_commits":166,"total_committers":2,"mean_commits":83.0,"dds":"0.10843373493975905","last_synced_commit":"aca9788489a6b7b977dd53ffc1f259ca91a9b962"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/ahungrynoob/jsonschema","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahungrynoob%2Fjsonschema","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahungrynoob%2Fjsonschema/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahungrynoob%2Fjsonschema/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahungrynoob%2Fjsonschema/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahungrynoob","download_url":"https://codeload.github.com/ahungrynoob/jsonschema/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahungrynoob%2Fjsonschema/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259410217,"owners_count":22852978,"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":["json-schema","napi-rs","nodejs","rust"],"created_at":"2024-09-24T20:53:51.386Z","updated_at":"2025-06-21T05:06:40.355Z","avatar_url":"https://github.com/ahungrynoob.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `@node-rs/jsonschema`\n\n![https://github.com/ahungrynoob/jsonschema/actions](https://github.com/ahungrynoob/jsonschema/workflows/CI/badge.svg)\n![](https://img.shields.io/npm/dm/@node-rs/jsonschema.svg?sanitize=true)\n\n\u003e A node package based on jsonschema-rs for performing JSON schema validation.\n\n## Bench\n**[ajv](https://github.com/ajv-validator/ajv) is much faster than this lib.**\n### Hardware\n```\nModel Name:\tMacBook Pro\nModel Identifier:\tMacBookPro16,1\nProcessor Name:\t6-Core Intel Core i7\nProcessor Speed:\t2.6 GHz\nNumber of Processors:\t1\nTotal Number of Cores:\t6\nL2 Cache (per Core):\t256 KB\nL3 Cache:\t12 MB\nHyper-Threading Technology:\tEnabled\nMemory:\t32 GB\n```\n### Result\n```\nRunning \"Validate Sync\" suite...\nProgress: 100%\n\n  @node-rs/jsonschema::validate:\n    2 642 863 ops/s, ±1.42%    | slowest, 92.86% slower\n\n  ajv::validate:\n    36 997 776 ops/s, ±0.46%   | fastest\n\nFinished 2 cases!\n  Fastest: ajv::validate\n  Slowest: @node-rs/jsonschema::validate\n```\n\n## Install\n\n```\nyarn add @node-rs/jsonschema\n```\n\n## Support matrix\n\n| Operating Systems| node12 | node14 | node16 |\n| ---------------- | ------ | ------ | ------ |\n| Windows x64      | ✓      | ✓      | ✓      |\n| Windows x32      | ✓      | ✓      | ✓      |\n| Windows arm64    | ✓      | ✓      | ✓      |\n| macOS x64        | ✓      | ✓      | ✓      |\n| macOS arm64      | ✓      | ✓      | ✓      |\n| Linux x64 gnu    | ✓      | ✓      | ✓      |\n| Linux x64 musl   | ✓      | ✓      | ✓      |\n| Linux arm gnu    | ✓      | ✓      | ✓      |\n| Linux arm64 gnu  | ✓      | ✓      | ✓      |\n| Linux arm64 musl | ✓      | ✓      | ✓      |\n| Android arm64    | ✓      | ✓      | ✓      |\n| FreeBSD x64      | ✓      | ✓      | ✓      |\n\n## Usage\n```javascript\nconst { compile } = require(\"@node-rs/jsonschema\");\n\nconst schema = {\n  type: 'object',\n  properties: {\n    foo: { type: 'integer' },\n    bar: { type: 'string' },\n  },\n  required: ['foo'],\n  additionalProperties: false,\n};\n\nconst input = JSON.stringify({\n  foo: 1,\n  bar: 'abc',\n})\n\nconst exceptionInput = JSON.stringify({\n  foo: 'abc',\n  bar: 1,\n})\n\nconst validator = compile(schema);\n\n// check whether the input meet schema\nconst result = validator(input);\nconsole.log(result); // true\n\nconst result = validator(exceptionInput);\nconsole.log(result); // false\n```\n\n## API\n```typescript\nexport declare class JSONSchema {\n  isValid(input: any): boolean\n}\n\nexport const compile: (schema: any) =\u003e (input: string) =\u003e boolean\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahungrynoob%2Fjsonschema","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahungrynoob%2Fjsonschema","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahungrynoob%2Fjsonschema/lists"}