@npxray/contracts
v0.4.5
Published
Shared npxray report contracts generated from the Go engine schema.
Readme
@npxray/contracts
Shared report contracts for npxray: generated report types, the Zod report schema, the signal catalog, and small formatting helpers used by the CLI, API, web app, and external integrations.
npm install @npxray/contractsimport { readFile } from "node:fs/promises";
import { formatBytes, reportSchema, signalCatalog } from "@npxray/contracts";
const rawReport = JSON.parse(await readFile("report.json", "utf8"));
const report = reportSchema.parse(rawReport);
const firstSignal = signalCatalog[0];
console.log(`${report.manifest.name} has ${report.findings.length} findings`);
console.log(`Tarball size: ${formatBytes(report.metrics.tarballBytes)}`);
console.log(`First signal: ${firstSignal.id} (${firstSignal.category})`);Read the product docs at https://npxray.dev/docs.
