Skip to content

Quickstart

This walks through a scan and how to read what comes back. It assumes you’ve installed Necro.

Point necro scan at a directory (defaults to the current directory):

Terminal window
necro scan src/

Necro discovers your TypeScript files, builds a symbol graph with the compiler API, resolves entry points, and reports anything unreachable.

The default output is a summary line followed by one evidence chain per finding, sorted worst-first:

3 findings (1 certain, 1 likely, 1 test-only)
deadFn src/util.ts:2 tier: certain
✓ 0 static references (TS compiler)
• coverage: not available
✓ not in package.json exports
✓ no dynamic-import taint in scope
→ safe to remove
lonelyExport src/util.ts:3 tier: likely
✓ 0 static references (TS compiler)
• coverage: not available
✓ not in package.json exports
✓ no dynamic-import taint in scope
→ exported but unused — confirm no external use, then remove
testUtil src/util.ts:4 tier: maybe
✓ 0 production references
✗ referenced only in test files
• coverage: not available
→ prod-dead — delete fn + test, or wire into prod

What this tells you:

  • deadFn is private and unreferenced → certain, safe to remove.
  • lonelyExport is exported but unused internally → likely; it might be consumed externally, so Necro asks you to confirm.
  • testUtil is reached only through test files → the test-only verdict.

Read more in Understanding results and Evidence chains.

Terminal window
necro scan src/ --json # machine-readable JSON
necro scan src/ --top 10 # only the 10 worst findings

See CI integration for using JSON in a pipeline.