@litehouse/metrics
v0.1.5
Published
Test/coverage/LOC metrics with a fully themeable report dashboard.
Maintainers
Readme
litehouse-metrics
Cross-platform CLI to generate test + coverage + cloc metrics and a static HTML report.
Install (local)
npm i -D @gfdlr/litehouse-metricsQuick start
# Run tests + generate metrics JSON
npx @litehouse/metrics run
# Build report + serve at http://localhost:8000
npx @litehouse/metrics serve --open
# Dev mode: run metrics, serve, watch JSON, open browser once
npx @litehouse/metrics devCommands
run– runs tests with coverage, optional cloc, writesmetrics/metrics.jsonandmetrics/history/metrics-<timestamp>.json.report– rebuildsmetrics/report/index.htmlfrom JSON.serve– rebuilds report and servesmetrics/report/on port 8000.watch– watches JSON and rebuilds report on change.dev–run+serve+watch+ open browser once.presets– list available presets.
Options
Common options:
--cwd <path>– project root (default: current working directory)--config <path>– path tolitehouse-metrics.config.json--preset <name>– apply a preset (next,node)--set <key=value>– override config values (repeatable)--port <number>– server port (default: 8000)--host <host>– server host (default:localhost)--open/--no-open– open browser--no-cloc– skip cloc--no-categories– skip per-category coverage runs--test-command <cmd>– custom test command to run instead of Vitest--test-summary <path>– optional path to test summary JSON--coverage-summary <path>– path to coverage summary JSON
Config file (optional)
Create litehouse-metrics.config.json in your project root to override defaults.
See the template in this repo: litehouse-metrics.config.json.
Presets:
next(default)node
Themes:
minimal(default)neon-hudThemes can also change the report layout. Themes live insrc/report-themes/and are loaded by filename. Layouts live insrc/report-layouts/and are selected by the themelayoutfield.
Add a new theme by copying an existing JSON file in src/report-themes/ and setting layout to minimal or hud.
Example theme override:
{
"report": {
"theme": "neon-hud"
}
}Example override without editing JSON:
npx @gfdlr/litehouse-metrics report --set report.charts.coverage.metric=branchesNotes
clocis optional. If it’s not installed, LOC metrics are omitted.vitestmust be available in the target project (localnode_modules/.binpreferred).- If you use
--test-command, ensure it producescoverage/coverage-summary.json. Optionally write a test summary JSON and point to it with--test-summary. - When
--test-commandis used, per-category coverage runs are skipped by default.
