Quickstart
This walks through a scan and how to read what comes back. It assumes you’ve installed Necro.
Run a scan
Section titled “Run a scan”Point necro scan at a directory (defaults to the current directory):
necro scan src/Necro discovers your TypeScript files, builds a symbol graph with the compiler API, resolves entry points, and reports anything unreachable.
Read the output
Section titled “Read the output”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 prodWhat this tells you:
deadFnis private and unreferenced →certain, safe to remove.lonelyExportis exported but unused internally →likely; it might be consumed externally, so Necro asks you to confirm.testUtilis reached only through test files → thetest-onlyverdict.
Read more in Understanding results and Evidence chains.
Other output modes
Section titled “Other output modes”necro scan src/ --json # machine-readable JSONnecro scan src/ --top 10 # only the 10 worst findingsSee CI integration for using JSON in a pipeline.