<h1 align="center"oasdiff-js</h1
<p align="center" TypeScript/JavaScript wrapper for <a href="https://github.com/oasdiff/oasdiff"oasdiff</a - a Go CLI for comparing OpenAPI specifications. </p
Installation
npm install @oasdiff-js/oasdiff-jsyarn add @oasdiff-js/oasdiff-jspnpm add @oasdiff-js/oasdiff-jsbun add @oasdiff-js/oasdiff-jsThe correct oasdiff binary for your platform is installed automatically via an optional dependency (macOS, Linux, Windows).
Development
The upstream oasdiff version used by this repo is oasdiffVersion in package.json.
After changing it locally, sync the dev binary for your platform before running tests or examples:
bun run sync-binariesSource code uses .oasdiff-bin/. Published packages use platform-specific optional dependencies instead.
Versioning model
Native packages (@oasdiff-js/oasdiff-) are versioned to match the upstream oasdiff binary they contain. The main @oasdiff-js/oasdiff-js package follows its own semver and pins exact native versions in optionalDependencies.
Usage
Programmatic API
import {runOasdiffBreaking} from "@oasdiff-js/oasdiff-js";
const result = await runOasdiffBreaking("base.yaml", "revision.yaml");
console.log(result.changes);
// [{ id: "api-removed-without-deprecation", text: "...", level: 3, ... }]