react-auditor 0.3.1

A blazing-fast Rust CLI to scan JS/TS/React code for best practices, quality, and security issues.
Documentation
#!/usr/bin/env node
const { execFileSync, execSync } = require("child_process");
const { join } = require("path");
const { existsSync } = require("fs");

function findBinary() {
  const local = join(__dirname, "react-auditor");
  if (existsSync(local)) return local;
  try {
    return execSync("which react-auditor", { encoding: "utf8" }).trim();
  } catch {
    return null;
  }
}

const bin = findBinary();

if (!bin) {
  console.error(
    "react-auditor binary not found.\n" +
      "This should be bundled with the npm package. Reinstall, or install via:\n" +
      "  cargo install react-auditor\n" +
      "  brew install react-auditor"
  );
  process.exit(1);
}

try {
  const status = execFileSync(bin, process.argv.slice(2), { stdio: "inherit" });
  process.exit(status.status ?? 0);
} catch (e) {
  process.exit(e.status ?? 1);
}