Getting Started
This page shows how to install compat-finder and start using it from the library or CLI as quickly as possible.
Requirements
- Library usage: any ESM-compatible runtime
- CLI usage: Node.js
^22 || >=24
Installation
Install compat-finder with your preferred package manager:
sh
npm install compat-findersh
pnpm add compat-findersh
yarn add compat-findersh
bun add compat-findersh
deno add npm:compat-findersh
vlt install compat-findersh
vp add compat-finderThen import it and create a session:
ts
import { createCompatibilitySession } from "compat-finder";
const session = createCompatibilitySession(["A", "B"]);If you just want to try the CLI, you can run it without installing it first:
sh
npx compat-finder --helpsh
pnpm dlx compat-finder --helpsh
yarn dlx compat-finder --helpsh
bunx compat-finder --helpsh
deno run npm:compat-finder --helpsh
vlx compat-finder --helpsh
vp exec compat-finderLibrary Example
The example below shows the smallest useful compat-finder session:
ts
import { createCompatibilitySession } from "compat-finder";
const session = createCompatibilitySession(["A", "B", "C", "D"]);
let step = session.current();
while (step.status === "testing") {
const result = askUser(step.targets);
if (result === "undo") {
step = session.undo();
continue;
}
step = session.answer(result === "issue");
}
console.log("Result:", step.targets);
function askUser(targets: readonly string[]): "issue" | "pass" | "undo" {
console.log("Targets to test:", targets);
return "issue";
}CLI Example
If you would rather start in the terminal, try these commands first.
Run a full interactive check:
sh
npx compat-finder interactive --count 4sh
pnpm dlx compat-finder interactive --count 4sh
yarn dlx compat-finder interactive --count 4sh
bunx compat-finder interactive --count 4sh
deno run npm:compat-finder interactive --count 4sh
vlx compat-finder interactive --count 4sh
vp exec compat-finder interactive --count 4Calculate the next targets to test from existing answers:
sh
npx compat-finder next -c 3 -n "Alpha,Beta,Gamma" -a "y,n"sh
pnpm dlx compat-finder next -c 3 -n "Alpha,Beta,Gamma" -a "y,n"sh
yarn dlx compat-finder next -c 3 -n "Alpha,Beta,Gamma" -a "y,n"sh
bunx compat-finder next -c 3 -n "Alpha,Beta,Gamma" -a "y,n"sh
deno run npm:compat-finder next -c 3 -n "Alpha,Beta,Gamma" -a "y,n"sh
vlx compat-finder next -c 3 -n "Alpha,Beta,Gamma" -a "y,n"sh
vp exec compat-finder next -c 3 -n "Alpha,Beta,Gamma" -a "y,n"Expected JSON output:
json
{
"status": "testing",
"targetCount": 3,
"targets": ["Beta"]
}Next
- Learn how to Work with AI
- Try compat-finder Online
- View CLI for the full command list and options
- View API Reference