npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@oasdiff-js/oasdiff-js

v1.0.0

Published

TypeScript/JavaScript wrapper for the oasdiff CLI

Readme

Installation

npm install @oasdiff-js/oasdiff-js
yarn add @oasdiff-js/oasdiff-js
pnpm add @oasdiff-js/oasdiff-js
bun add @oasdiff-js/oasdiff-js

The 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-binaries

Source 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, ... }]

From in-memory specs

import {runOasdiffBreakingFromSpecs} from "@oasdiff-js/oasdiff-js";

const result = await runOasdiffBreakingFromSpecs(baseSpec, revisionSpec);

API

Comparison commands

| Function | Description | | ----------------------------------------------- | --------------------- | | runOasdiffDiff(base, revision, options?) | Full structural diff | | runOasdiffSummary(base, revision, options?) | Summary of changes | | runOasdiffBreaking(base, revision, options?) | Breaking changes only | | runOasdiffChangelog(base, revision, options?) | All changes (info+) |

Each has a *FromSpecs variant that accepts objects instead of file paths.

Checks

import {runOasdiffChecks} from "@oasdiff-js/oasdiff-js";

const {checks} = await runOasdiffChecks();

Options

All comparison functions accept options for format, filtering, flattening, deprecation rules, etc:

await runOasdiffBreaking("base.yaml", "revision.yaml", {
  format: "json",
  failOn: "ERR",
  includeChecks: ["check-id"],
  flattenAllOf: true,
});

Result shape

interface IOasdiffRunResult {
  stdout: string;
  stderr: string;
  exitCode: number;
}

// Breaking and changelog also include:
interface IOasdiffBreakingResult extends IOasdiffRunResult {
  changes: IOasdiffChange[];
}

CLI

The package installs an oasdiff binary that you can use directly:

npx oasdiff breaking base.yaml revision.yaml
bunx oasdiff breaking base.yaml revision.yaml

For the full CLI reference, see the oasdiff documentation.

Troubleshooting

Binary not found after install

If the platform-specific optional dependency was not installed, the binary will be missing. This can happen when:

  • Optional dependencies are disabled: some CI environments or lockfile generators skip optional dependencies
  • Unsupported platform: your OS or architecture does not have a prebuilt binary

Reinstall with optional dependencies

rm -rf node_modules package-lock.json
npm install

For pnpm:

rm -rf node_modules pnpm-lock.yaml
pnpm install

For bun:

rm -rf node_modules bun.lock
bun install

Other environments

If the above does not work, you can also download the correct binary manually from the oasdiff releases page and pass its path to the programmatic API via the binaryPath option.

License

Apache-2.0