{"_id":"@apidiffguard/diff","name":"@apidiffguard/diff","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@apidiffguard/diff","version":"0.1.0","description":"JSON / API response diff engine used by APIDiffGuard — detect added, removed, and breaking field changes.","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"build":"tsc -p tsconfig.json","prepublishOnly":"npm run build"},"publishConfig":{"access":"public"},"keywords":["json","diff","api","openapi","breaking-change","schema-drift"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/orvi2014/apidiffguard.git","directory":"packages/diff-engine"},"homepage":"https://github.com/orvi2014/apidiffguard/tree/main/packages/diff-engine","bugs":{"url":"https://github.com/orvi2014/apidiffguard/issues"},"devDependencies":{"typescript":"^5"},"gitHead":"99352d8a670d27cfbee10a0832842c15995100fc","_id":"@apidiffguard/diff@0.1.0","_nodeVersion":"25.9.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-ixtwAXO159vdEqHn621TLRqSFFGXTDaUuF5eSBLfsw/iGgHVqtc6O8g9s3Hg3PMniKUVREbKCczScA8FEp7d7A==","shasum":"28f9b43f0dd2fa6f41e69251ffcce31225bbc2da","tarball":"https://registry.npmjs.org/@apidiffguard/diff/-/diff-0.1.0.tgz","fileCount":5,"unpackedSize":14135,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDF73iK1RNTD3jQg6Sy0pToEi5zFeJt+r+ypkQxU1q8UwIhAOx3aic49TH4EJJOj4XyGBcQtrScszZNr2litD9YdCmV"}]},"_npmUser":{"name":"orvi2025","email":"robatdas2018@gmail.com"},"directories":{},"maintainers":[{"name":"orvi2025","email":"robatdas2018@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/diff_0.1.0_1783968539849_0.9577772903243649"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-13T18:48:59.768Z","0.1.0":"2026-07-13T18:48:59.993Z","modified":"2026-07-13T18:49:00.153Z"},"maintainers":[{"name":"orvi2025","email":"robatdas2018@gmail.com"}],"description":"JSON / API response diff engine used by APIDiffGuard — detect added, removed, and breaking field changes.","homepage":"https://github.com/orvi2014/apidiffguard/tree/main/packages/diff-engine","keywords":["json","diff","api","openapi","breaking-change","schema-drift"],"repository":{"type":"git","url":"git+https://github.com/orvi2014/apidiffguard.git","directory":"packages/diff-engine"},"bugs":{"url":"https://github.com/orvi2014/apidiffguard/issues"},"license":"MIT","readme":"# @apidiffguard/diff\n\nOpen-source JSON / API response diff engine used by [APIDiffGuard](https://apidiffguard.com).\n\nDetect added, removed, type-changed, nullability, and value-changed fields — with severity (breaking / warning / info) suitable for CI gates. Supports schema-only mode, array identity matching, and status-class comparison.\n\n## Install\n\n```bash\nnpm install @apidiffguard/diff\n```\n\n## Usage\n\n```ts\nimport {\n  compareJson,\n  compareStatusCodes,\n  summarizeChanges,\n} from \"@apidiffguard/diff\";\n\nconst changes = compareJson(\n  { data: [{ id: 1, name: \"Alex\" }, { id: 2, name: \"Sam\" }] },\n  { data: [{ id: 2, name: \"Sam\" }, { id: 1, name: \"Alex\" }] },\n  { schemaOnly: true, arrayIdentity: true }\n);\n\nconst summary = summarizeChanges(changes);\n// reorder + value-stable → empty in schema mode\n\nconst status = compareStatusCodes(200, 500);\n// breaking — status class changed\n\nif (summary.breakingCount > 0 || status?.severity === \"breaking\") {\n  process.exit(1);\n}\n```\n\n## Options\n\n| Option | Default | Meaning |\n| --- | --- | --- |\n| `schemaOnly` | `false` | Ignore leaf value changes; keep structure/type/nullability |\n| `arrayIdentity` | `true` | Match object array items by `id` / `_id` / `uuid` / `key` / `slug` / `name` |\n| `ignorePaths` | `[]` | Extra paths to skip (plus built-in volatile leaves) |\n\n## What stays paid / hosted\n\nAPIDiffGuard’s hosted product adds baselines, scheduled checks, OpenAPI contract validation, alerts, workspace history, and the IDE-style console. This package is the core comparison engine — free to use in CI scripts and local tooling.\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-581def26449199466e18e7e8b0e99158"}