c8
$ c8 Community Low Riskc8 collects native V8 code coverage via NODE_V8_COVERAGE without Babel/Istanbul AST instrumentation overhead and formats reports using Istanbul reporters (--reporter=json, --reporter=json-summary, --reporter=text). Includes --check-coverage for CI threshold gates.
npm install -D c8 Local Node.js V8 coverage wrapper around node or test commands like mocha and node --test.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Non-interactive wrapper with --reporter=json, --reporter=json-summary, and --check-coverage exit codes.
- Native
--reporter=jsonand--reporter=json-summary --check-coveragereturns non-zero on threshold failure
Local execution with no auth; wraps arbitrary test commands and writes under coverage/ (configurable via --reports-dir).
- Bounded local file writes under
coverage/
Lightweight npm / npx package working across macOS, Linux, and Windows on Node.js 12+.
- Zero native compiler bindings; pure Node.js wrapper
Fast zero-instrumentation V8 coverage for node --test, mocha, ava, and CLI scripts.
- Leverages Node.js built-in V8 profiler without code transforms
Maintained by Benjamin Coe (bcoe/c8) under ISC license, widely used alongside node --test and mocha.
- Standard V8 coverage CLI in the Node.js ecosystem
Concise README and --help output documenting flags and .c8rc.json config.
- Clear flag reference in
--helpand README
Security, Auth & Guardrails
No credentials required; stores temporary V8 coverage JSON files locally in coverage/.
ISC open-source Node.js CLI; free.
# c8 Agent Rules - Combine `--reporter=json-summary` with `--reporter=text` for compact machine-readable totals. - Use `--clean` (default) or `c8 report` when inspecting existing V8 coverage output. - Pass `--all` only when uncovered files should count toward project totals.
Agent-Ready Command Recipes
Safe Read-Only Queries
npx c8 report --reporter=json-summary
Reads already collected V8 coverage data and writes a compact coverage-summary.json without re-running tests.
Controlled Writes & Previews
npx c8 --reporter=text --reporter=json-summary --check-coverage --lines 80 node --test
Executes Node's built-in test runner under V8 coverage, writes coverage/coverage-summary.json, and fails below 80% lines.
Strengths for Agents
- + Fast native V8 coverage with zero AST/Babel instrumentation overhead.
- +
--reporter=json-summaryproduces small JSON totals ideal for agent threshold checks. - +
--check-coverageenforces line/branch/function percentages directly.
Caveats & Pitfalls
- ! JSON reporters write files under
coverage/rather than printing raw JSON to stdout. - ! Source-map accuracy depends on Node.js
--enable-source-mapsor bundler-emitted maps.