{"id":15012994,"url":"https://github.com/twuni/vsj","last_synced_at":"2025-04-12T04:06:05.469Z","repository":{"id":65051981,"uuid":"581357121","full_name":"twuni/vsj","owner":"twuni","description":"VSJ is JSON Schema validation.","archived":false,"fork":false,"pushed_at":"2024-09-18T19:37:18.000Z","size":45,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-03T21:34:31.588Z","etag":null,"topics":["json-schema","json-schema-validator","jsonschema","jsonschema-validator"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/vsj","language":"JavaScript","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/twuni.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":"2022-12-23T00:37:39.000Z","updated_at":"2024-09-18T19:29:00.000Z","dependencies_parsed_at":"2024-09-30T05:00:41.841Z","dependency_job_id":"c30a696b-cbf6-47e7-850e-a30932aff5b9","html_url":"https://github.com/twuni/vsj","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"174d925a7627f0b5578b4547ce3f77bc563e6008"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twuni%2Fvsj","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twuni%2Fvsj/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twuni%2Fvsj/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twuni%2Fvsj/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/twuni","download_url":"https://codeload.github.com/twuni/vsj/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223494315,"owners_count":17154526,"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","json-schema-validator","jsonschema","jsonschema-validator"],"created_at":"2024-09-24T19:43:34.307Z","updated_at":"2024-11-07T10:04:56.391Z","avatar_url":"https://github.com/twuni.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VSJ is JSON Schema Validation\n\n\u003e :bulb: Learn more about JSON Schema at [json-schema.org][1].\n\n## Why?\n\nBecause after using it for years, I came to acknowledge that the current\nde facto standard library for JSON schema validation in JavaScript apps\n-- AJV -- is clunky. I thought, \"how hard could it be?\" Two days later,\nhere we are. As it turns out, not that hard.\n\nI primarily use JSON Schema validation for HTTP requests. For each endpoint,\nI model the query parameters, path parameters, and request body I expect as\na JSON Schema, and I short-circuit processing when this validation fails.\nIt's one of the many stages in a multi-stage request processing pipeline.\n\n## Features\n\n * lightweight and minimal -- zero dependencies\n * readable implementation -- learn from the source code\n * readable errors -- easy to see what failed and why\n * comprehensive test suite -- 100% code coverage\n * idiomatic usage -- failed validation throws an error\n * concurrency-friendly -- tightly scoped for massively parallel usage\n * fast -- highly tuned for validation performance\n * standard compliant -- IETF draft-bhutton-json-schema-validation-01 (2022-06-16)\n\n## Installing\n\nInstall VSJ just like you would any other npm package:\n\n```bash\nnpm install vsj\n```\n\n## Usage\n\n```javascript\nimport { createValidator } from 'vsj';\n\nconst validate = createValidator({ type: 'number' });\n\n// throws a validation error\nvalidate('hello world');\n\n// does not throw an error\nvalidate(123);\n```\n\n[1]: https://json-schema.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwuni%2Fvsj","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftwuni%2Fvsj","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwuni%2Fvsj/lists"}