{"_id":"@scalar/json-diff","_rev":"9-4667f5ff9bb1cc7e8932a498be0f7b52","name":"@scalar/json-diff","dist-tags":{"latest":"0.0.4"},"versions":{"0.0.1":{"name":"@scalar/json-diff","version":"0.0.1","author":{"url":"https://github.com/scalar","name":"Scalar"},"license":"MIT","_id":"@scalar/json-diff@0.0.1","maintainers":[{"name":"amritkahlon","email":"amritkahlon00@gmail.com"},{"name":"cameronrohani","email":"cam@scalar.com"},{"name":"marclave","email":"marc@scalar.com"},{"name":"tommastro","email":"tom@scalar.com"},{"name":"scalar_geoff","email":"geoff@scalar.com"},{"name":"hwkr","email":"bn@hwkr.me"},{"name":"mason-little","email":"mason@scalar.com"},{"name":"hanspagel","email":"mail@hanspagel.com"},{"name":"bgrcs","email":"bruno@grcs.pm"}],"homepage":"https://github.com/scalar/scalar","bugs":{"url":"https://github.com/scalar/scalar/issues/new/choose"},"dist":{"shasum":"e12c128314898bb47a848b4e1b564125b2053b4c","tarball":"https://registry.npmjs.org/@scalar/json-diff/-/json-diff-0.0.1.tgz","fileCount":45,"integrity":"sha512-4sEnVI2wXphLs0pzmYnAuIH8Isr7DvlUnk9snKAeR3sYdTQEPUGp1MpPgdW2p51uv7WMI4GidpQ0ff5Svlrzwg==","signatures":[{"sig":"MEQCIAFR9ZmOUhIHltOgFh592b6WmCKqspuwQNDMhgSh5p7+AiBeXqNWiamMqm0UR4BpXCl02doNK65DoVe0YJLKwxrchA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@scalar%2fjson-diff@0.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":111707},"type":"module","_from":"file:scalar-json-diff-0.0.1.tgz","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"test":"vitest test","build":"scalar-build-esbuild","types:build":"scalar-types-build","types:check":"scalar-types-check"},"_npmUser":{"name":"hanspagel","email":"mail@hanspagel.com"},"_resolved":"/tmp/633cc34e1e4498a33d6747f38856b1be/scalar-json-diff-0.0.1.tgz","_integrity":"sha512-4sEnVI2wXphLs0pzmYnAuIH8Isr7DvlUnk9snKAeR3sYdTQEPUGp1MpPgdW2p51uv7WMI4GidpQ0ff5Svlrzwg==","repository":{"url":"git+https://github.com/scalar/scalar.git","type":"git","directory":"packages/json-diff"},"_npmVersion":"10.9.2","description":"Diffing and conflict resolution tool for JSON objects","directories":{},"_nodeVersion":"22.15.0","_hasShrinkwrap":false,"devDependencies":{"vite":"5.4.19","@scalar/build-tooling":"0.2.2"},"_npmOperationalInternal":{"tmp":"tmp/json-diff_0.0.1_1749165424702_0.7286539163056407","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@scalar/json-diff","version":"0.0.2","author":{"url":"https://github.com/scalar","name":"Scalar"},"license":"MIT","_id":"@scalar/json-diff@0.0.2","maintainers":[{"name":"amritkahlon","email":"amritkahlon00@gmail.com"},{"name":"cameronrohani","email":"cam@scalar.com"},{"name":"marclave","email":"marc@scalar.com"},{"name":"tommastro","email":"tom@scalar.com"},{"name":"scalar_geoff","email":"geoff@scalar.com"},{"name":"hwkr","email":"bn@hwkr.me"},{"name":"mason-little","email":"mason@scalar.com"},{"name":"hanspagel","email":"mail@hanspagel.com"},{"name":"bgrcs","email":"bruno@grcs.pm"},{"name":"scalar-machine","email":"machine@scalar.com"}],"homepage":"https://github.com/scalar/scalar","bugs":{"url":"https://github.com/scalar/scalar/issues/new/choose"},"dist":{"shasum":"50840a6e80c9e0fb6cc20521316eae5c1ac797a2","tarball":"https://registry.npmjs.org/@scalar/json-diff/-/json-diff-0.0.2.tgz","fileCount":45,"integrity":"sha512-GuoQo2PL9GsUi1LbPBXpUXp3GwqoyIESW0fx6jbLbvZAhrqLMhOMQS9VjPfVeXuRM1mH3dT8dE/kS0bOjZsJGA==","signatures":[{"sig":"MEUCIQC0Hmiup443TOHVShDnHOqzZWTdSV12hpr+VApBhlPYYgIgaCg10nKDSZOiUmlnVMq61BK1vuCqOJSxHMO4sCA4Zec=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@scalar%2fjson-diff@0.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":111761},"type":"module","_from":"file:scalar-json-diff-0.0.2.tgz","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"test":"vitest test","build":"scalar-build-esbuild","types:build":"scalar-types-build","types:check":"scalar-types-check"},"_npmUser":{"name":"hanspagel","email":"mail@hanspagel.com"},"_resolved":"/tmp/3b8a6bf1833d6e87c1c4c31dae0beef8/scalar-json-diff-0.0.2.tgz","_integrity":"sha512-GuoQo2PL9GsUi1LbPBXpUXp3GwqoyIESW0fx6jbLbvZAhrqLMhOMQS9VjPfVeXuRM1mH3dT8dE/kS0bOjZsJGA==","repository":{"url":"git+https://github.com/scalar/scalar.git","type":"git","directory":"packages/json-diff"},"_npmVersion":"10.9.2","description":"Diffing and conflict resolution tool for JSON objects","directories":{},"_nodeVersion":"22.16.0","_hasShrinkwrap":false,"devDependencies":{"vite":"5.4.19","@scalar/build-tooling":"0.2.3"},"_npmOperationalInternal":{"tmp":"tmp/json-diff_0.0.2_1749825093265_0.038847085153924654","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@scalar/json-diff","version":"0.0.3","author":{"url":"https://github.com/scalar","name":"Scalar"},"license":"MIT","_id":"@scalar/json-diff@0.0.3","maintainers":[{"name":"amritkahlon","email":"amritkahlon00@gmail.com"},{"name":"cameronrohani","email":"cam@scalar.com"},{"name":"marclave","email":"marc@scalar.com"},{"name":"tommastro","email":"tom@scalar.com"},{"name":"scalar_geoff","email":"geoff@scalar.com"},{"name":"hwkr","email":"bn@hwkr.me"},{"name":"mason-little","email":"mason@scalar.com"},{"name":"hanspagel","email":"mail@hanspagel.com"},{"name":"bgrcs","email":"bruno@grcs.pm"},{"name":"scalar-machine","email":"machine@scalar.com"}],"homepage":"https://github.com/scalar/scalar","bugs":{"url":"https://github.com/scalar/scalar/issues/new/choose"},"dist":{"shasum":"8fc3eaf99a972185fdf77deaec5c93b05db3ff6c","tarball":"https://registry.npmjs.org/@scalar/json-diff/-/json-diff-0.0.3.tgz","fileCount":45,"integrity":"sha512-oAvCyoe6RR1eKv9VYNXOWoxECSOdyh+dmulJtXZt4QutyQIl4VlpLWpG4VJdP/OKGyTcAta8WReWOFJb8Yoq6A==","signatures":[{"sig":"MEYCIQD2C5Kam43ZcoXwn6LMVmNDYJ1TdFJeZ69/WE93sDMnaAIhAOLMGBP2fI9jIXZrEYFLr5MBNdO6bhcUfzIAUXH0FVQw","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@scalar%2fjson-diff@0.0.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":112500},"type":"module","_from":"file:scalar-json-diff-0.0.3.tgz","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"test":"vitest test","build":"scalar-build-esbuild","types:build":"scalar-types-build","types:check":"scalar-types-check"},"_npmUser":{"name":"hanspagel","actor":{"name":"hanspagel","type":"user","email":"mail@hanspagel.com"},"email":"mail@hanspagel.com"},"_resolved":"/tmp/b98677ab46164df2a0f51777dbd93d25/scalar-json-diff-0.0.3.tgz","_integrity":"sha512-oAvCyoe6RR1eKv9VYNXOWoxECSOdyh+dmulJtXZt4QutyQIl4VlpLWpG4VJdP/OKGyTcAta8WReWOFJb8Yoq6A==","repository":{"url":"git+https://github.com/scalar/scalar.git","type":"git","directory":"packages/json-diff"},"_npmVersion":"10.9.2","description":"Diffing and conflict resolution tool for JSON objects","directories":{},"_nodeVersion":"22.16.0","_hasShrinkwrap":false,"devDependencies":{"vite":"5.4.19","@scalar/build-tooling":"0.2.3"},"_npmOperationalInternal":{"tmp":"tmp/json-diff_0.0.3_1750342331700_0.1977729381514095","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"@scalar/json-diff","version":"0.0.4","author":{"url":"https://github.com/scalar","name":"Scalar"},"license":"MIT","_id":"@scalar/json-diff@0.0.4","maintainers":[{"name":"amritkahlon","email":"amritkahlon00@gmail.com"},{"name":"cameronrohani","email":"cam@scalar.com"},{"name":"marclave","email":"marc@scalar.com"},{"name":"tommastro","email":"tom@scalar.com"},{"name":"scalar_geoff","email":"geoff@scalar.com"},{"name":"hwkr","email":"bn@hwkr.me"},{"name":"mason-little","email":"mason@scalar.com"},{"name":"hanspagel","email":"mail@hanspagel.com"},{"name":"bgrcs","email":"bruno@grcs.pm"},{"name":"scalar-machine","email":"machine@scalar.com"}],"homepage":"https://github.com/scalar/scalar","bugs":{"url":"https://github.com/scalar/scalar/issues/new/choose"},"dist":{"shasum":"c145f0d5909f17c4f21c5fe4da8b2ab7201bc96e","tarball":"https://registry.npmjs.org/@scalar/json-diff/-/json-diff-0.0.4.tgz","fileCount":45,"integrity":"sha512-4u2gtyhA119T+HdQ4dVKYzQOCOos5Iaj08C1H2Hi6WW64sTNJaZuh9hpVtY94e0I9feRiCyNEtWvmbOjOAxbTw==","signatures":[{"sig":"MEQCIGih9gNhXe7Ax5JKQBAnAhZxWyKEBDwNoqzYq3yRJysjAiA0Sd2aPehPS6qZrEz25qehH90o+HUaRdSC5ftXFyEZMg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@scalar%2fjson-diff@0.0.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":112755},"type":"module","_from":"file:scalar-json-diff-0.0.4.tgz","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"test":"vitest test","build":"scalar-build-esbuild","types:build":"scalar-types-build","types:check":"scalar-types-check"},"_npmUser":{"name":"hanspagel","actor":{"name":"hanspagel","type":"user","email":"mail@hanspagel.com"},"email":"mail@hanspagel.com"},"_resolved":"/tmp/912e34375fa08804c6430443e2d64c29/scalar-json-diff-0.0.4.tgz","_integrity":"sha512-4u2gtyhA119T+HdQ4dVKYzQOCOos5Iaj08C1H2Hi6WW64sTNJaZuh9hpVtY94e0I9feRiCyNEtWvmbOjOAxbTw==","repository":{"url":"git+https://github.com/scalar/scalar.git","type":"git","directory":"packages/json-diff"},"_npmVersion":"10.9.2","description":"Diffing and conflict resolution tool for JSON objects","directories":{},"_nodeVersion":"22.17.0","_hasShrinkwrap":false,"devDependencies":{"vite":"5.4.19","@scalar/build-tooling":"0.2.4"},"_npmOperationalInternal":{"tmp":"tmp/json-diff_0.0.4_1751895285241_0.5834385012294598","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-06-05T23:17:04.626Z","modified":"2026-08-14T19:29:57.372Z","0.0.1":"2025-06-05T23:17:04.933Z","0.0.2":"2025-06-13T14:31:33.427Z","0.0.3":"2025-06-19T14:12:11.851Z","0.0.4":"2025-07-07T13:34:45.447Z"},"bugs":{"url":"https://github.com/scalar/scalar/issues/new/choose"},"author":{"url":"https://github.com/scalar","name":"Scalar"},"license":"MIT","homepage":"https://github.com/scalar/scalar","repository":{"url":"git+https://github.com/scalar/scalar.git","type":"git","directory":"packages/json-diff"},"description":"Diffing and conflict resolution tool for JSON objects","maintainers":[{"email":"cam@scalar.com","name":"cameronrohani"},{"email":"marc@scalar.com","name":"marclave"},{"email":"geoff@scalar.com","name":"scalar_geoff"},{"email":"bn@hwkr.me","name":"hwkr"},{"email":"mail@hanspagel.com","name":"hanspagel"},{"email":"amrit+spam@hockey-community.com","name":"amritk"},{"email":"machine@scalar.com","name":"scalar-machine"}],"readme":"# Scalar JSON Diff\n\n[![Version](https://img.shields.io/npm/v/%40scalar/json-diff)](https://www.npmjs.com/package/@scalar/json-diff)\n[![Downloads](https://img.shields.io/npm/dm/%40scalar/json-diff)](https://www.npmjs.com/package/@scalar/json-diff)\n[![License](https://img.shields.io/npm/l/%40scalar%2Fjson-diff)](https://www.npmjs.com/package/@scalar/json-diff)\n[![Discord](https://img.shields.io/discord/1135330207960678410?style=flat&color=5865F2)](https://discord.gg/scalar)\n\nThis package provides a way to compare two OpenAPI definitions and get the differences, resolve conflicts and return conflicts that need to be resolved manually.\n\n# Quickstart\n\n```ts\nimport { apply, diff, merge } from '@scalar/json-diff'\n\nconst baseDocument = {\n  openapi: '3.0.0',\n  info: {\n    title: 'Simple API',\n    description: 'A small OpenAPI specification example',\n    version: '1.0.0',\n  },\n}\n\nconst documentV1 = {\n  openapi: '3.0.0',\n  info: {\n    title: 'Simple API',\n    description: 'A small OpenAPI specification example',\n    version: '1.0.0',\n  },\n  change: 'This is a new property',\n}\n\nconst documentV2 = {\n  openapi: '3.0.0',\n  info: {\n    title: 'Simple API',\n    description: 'A small OpenAPI specification example',\n    version: '1.0.1',\n  },\n}\n\n// Merge the changes of both versions with the same parent document\nconst { diffs, conflicts } = merge(\n  diff(baseDocument, documentV1),\n  diff(baseDocument, documentV2),\n)\n\n// Apply changes from v1 and v2 to the parent document to get the final document\nconst finalDocument = apply(baseDocument, diffs)\n```\n\n## Community\n\nWe are API nerds. You too? Let's chat on Discord: <https://discord.gg/scalar>\n\n## License\n\nThe source code in this repository is licensed under [MIT](https://github.com/scalar/scalar/blob/main/LICENSE).\n","readmeFilename":"README.md"}