{"id":28761692,"url":"https://github.com/asyncapi/diff","last_synced_at":"2025-06-17T07:40:26.072Z","repository":{"id":37935275,"uuid":"371317292","full_name":"asyncapi/diff","owner":"asyncapi","description":"Diff is a library that compares two AsyncAPI Documents and provides information about the differences by pointing out explicitly information like breaking changes.","archived":false,"fork":false,"pushed_at":"2025-06-04T19:16:30.000Z","size":1018,"stargazers_count":26,"open_issues_count":3,"forks_count":14,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-06-11T13:35:59.437Z","etag":null,"topics":["asyncapi","cli","get-global-node-release-workflows","get-global-releaserc","javascript","nodejs","typescript"],"latest_commit_sha":null,"homepage":"","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/asyncapi.png","metadata":{"funding":{"github":"asyncapi","patreon":null,"open_collective":"asyncapi","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null},"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-05-27T09:25:09.000Z","updated_at":"2025-06-04T19:16:30.000Z","dependencies_parsed_at":"2023-09-26T06:08:44.281Z","dependency_job_id":"3bde6cf8-b66e-4345-8772-440ee6a2d967","html_url":"https://github.com/asyncapi/diff","commit_stats":{"total_commits":164,"total_committers":8,"mean_commits":20.5,"dds":"0.17682926829268297","last_synced_commit":"50382b9ee661e47adcd14dd775e4985841f6d248"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/asyncapi/diff","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asyncapi%2Fdiff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asyncapi%2Fdiff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asyncapi%2Fdiff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asyncapi%2Fdiff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asyncapi","download_url":"https://codeload.github.com/asyncapi/diff/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asyncapi%2Fdiff/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260026199,"owners_count":22947765,"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":["asyncapi","cli","get-global-node-release-workflows","get-global-releaserc","javascript","nodejs","typescript"],"created_at":"2025-06-17T07:40:21.511Z","updated_at":"2025-06-17T07:40:26.058Z","avatar_url":"https://github.com/asyncapi.png","language":"TypeScript","funding_links":["https://github.com/sponsors/asyncapi","https://opencollective.com/asyncapi"],"categories":[],"sub_categories":[],"readme":"[![AsyncAPI Diff](/assets/logo.png)](https://www.asyncapi.com)\n\nAsyncDiff is a library that compares two AsyncAPI files and provides information about the differences by pointing out explicitly information like breaking changes.\n\n![npm](https://img.shields.io/npm/v/@asyncapi/diff?style=for-the-badge) ![npm](https://img.shields.io/npm/dt/@asyncapi/diff?style=for-the-badge)\n\n\u003c!-- toc is generated with GitHub Actions do not remove toc markers --\u003e\n\n\u003c!-- toc --\u003e\n\n- [Features](#features)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Standard object](#standard-object)\n  * [Overriding the standard](#overriding-the-standard)\n- [Example](#example)\n- [Output](#output)\n- [API](#api)\n- [Develop](#develop)\n- [Contributing](#contributing)\n- [Contributors](#contributors)\n\n\u003c!-- tocstop --\u003e\n\n## Features\n\n- Get explicit information about the changes you make to your AsyncAPI files, such as breaking, non-breaking and unclassified changes.\n- Different types of output such as JSON, YAML and Markdown.\n\n## Installation\n\n```\nnpm install @asyncapi/diff\n```\n\n## Usage\n\n**NOTE:** The library doesn't have a built-in parser to parse the given AsyncAPI document. Thus, you have to make sure they provide the valid \u0026 dereferenced AsyncAPI document as an input. You can use the [AsyncAPI parser](https://github.com/asyncapi/parser-js) to parse and validate the AsyncAPI file first. You can use other tools, but you **must** make sure that the document is valid and dereferenced.\n\n```js\nimport { diff } from \"@asyncapi/diff\"; // const { diff } = require('@asyncapi/diff');\n\nconst output = diff(firstDocument, secondDocument, {\n  override: {\n    // object to override the standard\n  },\n});\n```\n\n## Standard object\n\nThis library has a pre-configured standard which marks a change as `breaking`, `non-breaking` or `unclassified`. This standard data is stored as an object inside the [`standard.ts`](https://github.com/asyncapi/diff/blob/master/src/standard.ts) file.\n\nThe format of this standard object is explained in [this](standard-format.md) document.\n\n### Overriding the standard\n\nTo understand the format of overriding object, take a look at [this](standard-format.md) document.\n\nThe overrides object must be passed in the following format:\n\n```\n{\n\t[jsonPointer]: {\n\t\tadd: 'breaking' | 'non-breaking' | 'unclassified'\n\t\tremove: 'breaking' | 'non-breaking' | 'unclassified'\n\t\tedit: 'breaking' | 'non-breaking' | 'unclassified'\n\t}\n}\n```\n\n## Example\n\nSee the [index](./docs/modules/index.md) document to get all the helper methods this library offers.\n\n1. Without any overrides\n\n```js\nconst output = diff(firstDocument, secondDocument);\n\noutput.getOutput(); // the whole output data\noutput.breaking(); // the breaking changes\noutput.nonBreaking(); // the non-breaking changes\noutput.unclassified(); // the unclassified changes\n```\n\n2. With overrides\n\n```js\nconst output = diff(firstDocument, secondDocument, {\n  override: {\n    \"/servers/*/protocol\": {\n      add: \"non-breaking\",\n      remove: \"breaking\",\n      edit: \"unclassified\",\n    },\n  },\n});\n```\n\n## Output\n\nThis library supports outputs:\n\n- JSON: `json`\n- YAML: `yaml` or `yml`\n- Markdown: `markdown` or `md`\n\n```js\nconst jsonOutput = diff(firstDocument, secondDocument, {\n  outputType: \"json\",\n});\n\nconst yamlOutput = diff(firstDocument, secondDocument, {\n  outputType: \"yaml\" | \"yml\",\n});\n\nconst markdownOutput = diff(firstDocument, secondDocument, {\n  outputType: \"markdown\" | \"md\",\n});\n```\n\nWith markdown output, you can also choose subtypes of the changes as JSON(`json`) or YAML(`yaml` or `yml`).\n\n```js\nconst markdownOutput = diff(firstDocument, secondDocument, {\n  outputType: \"markdown\" | \"md\",\n  markdownSubtype: \"json\" | \"yaml\" | \"yml\",\n});\n```\n\n## API\n\nCheckout the [index](./docs/modules/index.md) document to see all the APIs this library offers.\n\n## Develop\n\n1. Write code and tests\n2. Make sure all tests pass `npm run test`\n3. Make sure code is well formatted and secure `npm run lint`\n\n## Contributing\n\nHelp us make this library more robust. Read [CONTRIBUTING](https://github.com/asyncapi/.github/blob/master/CONTRIBUTING.md) guide \u0026 start contributing.\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://aayushsahu.com/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/54525741?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAayush Kumar Sahu\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/aayushmau5/diff/commits?author=aayushmau5\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/aayushmau5/diff/commits?author=aayushmau5\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"#maintenance-aayushmau5\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e \u003ca href=\"#ideas-aayushmau5\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e \u003ca href=\"https://github.com/aayushmau5/diff/pulls?q=is%3Apr+reviewed-by%3Aaayushmau5\" title=\"Reviewed Pull Requests\"\u003e👀\u003c/a\u003e \u003ca href=\"https://github.com/aayushmau5/diff/commits?author=aayushmau5\" title=\"Tests\"\u003e⚠️\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://www.brainfart.dev/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/6995927?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eLukasz Gornicki\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#ideas-derberg\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e \u003ca href=\"https://github.com/aayushmau5/diff/pulls?q=is%3Apr+reviewed-by%3Aderberg\" title=\"Reviewed Pull Requests\"\u003e👀\u003c/a\u003e \u003ca href=\"#maintenance-derberg\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/magicmatatjahu\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/20404945?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMaciej Urbańczyk\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/aayushmau5/diff/pulls?q=is%3Apr+reviewed-by%3Amagicmatatjahu\" title=\"Reviewed Pull Requests\"\u003e👀\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/jonaslagoni\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/13396189?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJonas Lagoni\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/aayushmau5/diff/pulls?q=is%3Apr+reviewed-by%3Ajonaslagoni\" title=\"Reviewed Pull Requests\"\u003e👀\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/vinitshahdeo\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/20594326?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eVinit Shahdeo\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/aayushmau5/diff/pulls?q=is%3Apr+reviewed-by%3Avinitshahdeo\" title=\"Reviewed Pull Requests\"\u003e👀\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://www.linkedin.com/in/anubhav-vats-0688b5187/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/46771418?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAnubhav Vats\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/aayushmau5/diff/pulls?q=is%3Apr+reviewed-by%3Aonbit-uchenik\" 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/shivensinha4\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/19777714?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eShiven Sinha\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/aayushmau5/diff/commits?author=shivensinha4\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/aayushmau5/diff/commits?author=shivensinha4\" title=\"Tests\"\u003e⚠️\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/ron-debajyoti\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/22571664?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eDebajyoti Halder\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/aayushmau5/diff/commits?author=ron-debajyoti\" title=\"Documentation\"\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasyncapi%2Fdiff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasyncapi%2Fdiff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasyncapi%2Fdiff/lists"}