Docs

big-brocode is a CLI and ESM library for explaining JS/TS/React errors and running lightweight diagnostics with TypeScript power.

What it does

  • Explains raw errors, codes, and stack traces.
  • Runs analyze mode with TypeScript diagnostics.
  • Exports text, JSON, ESLint, and SARIF outputs.

Install

npm install -g big-brocode
# or per-project
npm install --save-dev big-brocode

CLI usage

Explain an error from a message, code, or stack trace.

bigbro "TS2339: Property 'x' does not exist on type 'User'"

bigbro --message "TypeError: Cannot read properties of undefined" --language javascript
bigbro --code 2304 --language typescript
bigbro --stack "TypeError: Cannot read properties of undefined\n    at src/app.js:10:5"

Common options

  • -m, --message Error message to explain.
  • -l, --language javascript, typescript, javascriptreact, typescriptreact.
  • -c, --code Numeric error code like 2339.
  • -s, --stack Stack trace input.
  • --json Shortcut for JSON output.

Analyze mode

Scan files or projects with TypeScript diagnostics and heuristics.

# Analyze all JS/TS files under a directory
bigbro analyze fixtures

# Specific globs
bigbro analyze "src/**/*.ts" "app/**/*.tsx"

# ESLint-format output
bigbro analyze fixtures --format eslint

# Safe autofix (experimental)
bigbro analyze src --fix

Output formats

Text

Developer-friendly explanation and next step guidance.

JSON

Structured data for scripts and automation.

ESLint

Drop-in compatibility with linting workflows.

SARIF

Security and code scanning dashboards.

Library usage (ESM)

import {
  explainError,
  explainFromStackTrace,
  analyzeFile,
  analyzeFiles,
} from "big-brocode";
const stackString = 'your stack trace string here eg: "TypeError: ... at file.js:10:5"';
const entry = explainError({ message: "TS2339: Property 'x' does not exist" });
const stackEntry = explainFromStackTrace(stackString);
const single = analyzeFile("src/example.ts");
const many = analyzeFiles(["src/**/*.ts"]);

Exit codes

  • 0 Explanations or findings exist.
  • 2 No explanations or findings.