{"id":20330079,"url":"https://github.com/json-schema-tools/traverse","last_synced_at":"2025-04-11T21:02:51.568Z","repository":{"id":37820928,"uuid":"236639556","full_name":"json-schema-tools/traverse","owner":"json-schema-tools","description":"Traverse and optionally mutate a json schema and all it's subschema","archived":false,"fork":false,"pushed_at":"2025-01-21T10:18:57.000Z","size":1591,"stargazers_count":10,"open_issues_count":14,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T21:02:34.229Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://json-schema-tools.github.io/traverse/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/json-schema-tools.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","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},"funding":{"github":"belfordz","open_collective":"zachary-belford"}},"created_at":"2020-01-28T02:09:44.000Z","updated_at":"2024-12-05T08:17:43.000Z","dependencies_parsed_at":"2024-06-18T18:20:39.261Z","dependency_job_id":"0ef4cd5a-cce3-4509-814a-24da5004a467","html_url":"https://github.com/json-schema-tools/traverse","commit_stats":{"total_commits":177,"total_committers":6,"mean_commits":29.5,"dds":0.5988700564971752,"last_synced_commit":"86b27b520ea63fa0c9050137af0bff56abccfeba"},"previous_names":[],"tags_count":34,"template":false,"template_full_name":"etclabscore/pristine-typescript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/json-schema-tools%2Ftraverse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/json-schema-tools%2Ftraverse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/json-schema-tools%2Ftraverse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/json-schema-tools%2Ftraverse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/json-schema-tools","download_url":"https://codeload.github.com/json-schema-tools/traverse/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248480437,"owners_count":21110937,"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-14T20:14:53.266Z","updated_at":"2025-04-11T21:02:51.201Z","avatar_url":"https://github.com/json-schema-tools.png","language":"TypeScript","funding_links":["https://github.com/sponsors/belfordz","https://opencollective.com/zachary-belford"],"categories":[],"sub_categories":[],"readme":"# JSON Schema Traverse\n\n\u003ccenter\u003e\n  \u003cspan\u003e\n    \u003cimg alt=\"CircleCI branch\" src=\"https://img.shields.io/circleci/project/github/json-schema-tools/traverse/master.svg\"\u003e\n    \u003cimg src=\"https://codecov.io/gh/json-schema-tools/traverse/branch/master/graph/badge.svg\" /\u003e\n    \u003cimg alt=\"npm\" src=\"https://img.shields.io/npm/dt/@json-schema-tools/traverse.svg\" /\u003e\n    \u003cimg alt=\"GitHub release\" src=\"https://img.shields.io/github/release/json-schema-tools/traverse.svg\" /\u003e\n    \u003cimg alt=\"GitHub commits since latest release\" src=\"https://img.shields.io/github/commits-since/json-schema-tools/traverse/latest.svg\" /\u003e\n  \u003c/span\u003e\n\u003c/center\u003e\n\nThis package exports a method that will traverse a JSON-Schema, calling a \"mutation\" function for each sub schema found. It is useful for building tools to work with JSON Schemas.\n\n## Features\n\n - circular reference detection \u0026 handling\n - synchronous - doesn't touch the filesystem or make network requests.\n - easily perform schema mutations while traversing\n - optional mutability (toggle updating original schema object)\n - returns [JSONPaths](https://www.ietf.org/archive/id/draft-goessner-dispatch-jsonpath-00.html) as it traverses\n\n## Getting Started\n\n```sh\nnpm install @json-schema-tools/traverse\n```\n\n```js\nconst traverse = require(\"@json-schema-tools/traverse\").default;\n//import traverse from \"@json-schema-tools/traverse\"\n\nconst mySchema = {\n  title: \"baz\",\n  type: \"object\",\n  properties: {\n    foo: {\n      title: \"foo\",\n      type: \"array\",\n      items: { type: \"string\" }\n    },\n    bar: {\n      title: \"bar\",\n      anyOf: [\n        { title: \"stringerific\", type: \"string\" },\n        { title: \"numberoo\", type: \"number\" }\n      ]\n    }\n  }\n};\n\ntraverse(mySchema, (schemaOrSubschema) =\u003e {\n  console.log(schemaOrSubschema.title);\n});\n```\n\n## API Docs\n\nhttps://json-schema-tools.github.io/traverse/\n\n## Features Todo\n\n - unevaluatedItems (https://json-schema.org/draft/2019-09/json-schema-core.html#rfc.section.9.3.1.3)\n - unevaluatedProperties (https://json-schema.org/draft/2019-09/json-schema-core.html#rfc.section.9.3.2.4)\n - contains (https://json-schema.org/draft/2019-09/json-schema-core.html#rfc.section.9.3.1.4)\n - propertyNames (https://json-schema.org/draft/2019-09/json-schema-core.html#rfc.section.9.3.2.5)\n\n### Contributing\n\nHow to contribute, build and release are outlined in [CONTRIBUTING.md](CONTRIBUTING.md), [BUILDING.md](BUILDING.md) and [RELEASING.md](RELEASING.md) respectively. Commits in this repository follow the [CONVENTIONAL_COMMITS.md](CONVENTIONAL_COMMITS.md) specification.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjson-schema-tools%2Ftraverse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjson-schema-tools%2Ftraverse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjson-schema-tools%2Ftraverse/lists"}