@0xdoublesharp/doublcov

中文文档
0.4.5发布于 2026/10/24MITES Module零依赖构建来源已验证近 30 天下载 1708

Find what's missing with static LCOV coverage reports

原始使用文档
文档目录12 节
  1. What You Get
  2. Install
  3. Commands
  4. Supported Builders
  5. Solidity
  6. JavaScript And TypeScript
  7. Python, Rust, C, And C++
  8. Diagnostics
  9. Themes And UI Hooks
  10. Output Hosting
  11. GitHub Action
  12. Distribution
Doublcov report mark

@0xdoublesharp/doublcov

Find what's missing in LCOV coverage.

Static, self-contained coverage reports with source browsing, uncovered navigation, history, diagnostics, syntax highlighting, themes, and declarative UI hooks.

npm CI License: MIT

Build from an existing lcov.info file or run one of the built-in coverage builders first:

npx @0xdoublesharp/doublcov build --lcov lcov.info --sources src

What You Get

  • A portable static report directory you can upload to CI artifacts or any static host.
  • Built-in builders for Foundry, Hardhat, Vitest, Jest, Node/V8, pytest, Rust coverage tools, and gcov/lcov.
  • Source-level navigation for uncovered lines, branch/function totals, parser diagnostics, and historical coverage.
  • A GitHub Action, npm package, standalone binaries, and Docker image for different project shapes.

Install

npm install --save-dev @0xdoublesharp/doublcov

or:

pnpm add -D @0xdoublesharp/doublcov

Run without installing:

npx @0xdoublesharp/doublcov build

or:

pnpm dlx @0xdoublesharp/doublcov build

The executable is:

doublcov

Commands

Build from existing LCOV:

doublcov build \
  --lcov lcov.info \
  --sources src

Run a builder and then build the report:

doublcov foundry -- --exclude-tests --ir-minimum
doublcov hardhat
doublcov vite
doublcov jest
doublcov v8
doublcov pytest
doublcov cargo-llvm-cov
doublcov cargo-tarpaulin
doublcov lcov-capture

Local builds open the generated index.html automatically. Open an existing report directory:

doublcov open coverage/report

For large projects or hosted reports, generate split static assets:

doublcov build --mode static --no-open
doublcov open coverage/report

standalone mode is the local default and writes a self-contained index.html that can be opened from disk. static mode is the CI default and writes index.html, assets, and lazy-loaded JSON files for GitHub Pages and other static hosts. doublcov open detects the report type: standalone reports open directly, and static reports are served on an available local port. Static preview runs in the foreground and stops automatically after 30 minutes unless extended from the browser.

Generic build defaults:

  • LCOV path: lcov.info
  • source path: src
  • output directory: coverage/report
  • history file: .doublcov/history.json

Builder commands also read ecosystem config and place the report next to the resolved LCOV file when --out is not set.

Supported Builders

  • foundry / forge: runs forge coverage --report lcov
  • hardhat: runs npx hardhat coverage
  • vite / vitest: runs npx vitest run --coverage --coverage.reporter=lcov
  • jest: runs npx jest --coverage --coverageReporters=lcov
  • c8 / v8 / node / node-test: runs npx c8 --reporter=lcov node --test
  • pytest / python / coverage.py: runs python -m pytest --cov --cov-report=lcov:<path>
  • cargo-llvm-cov / llvm-cov / rust: runs cargo llvm-cov --lcov --output-path <path>
  • cargo-tarpaulin / tarpaulin: runs cargo tarpaulin --out Lcov
  • lcov-capture / lcov / gcov / c / cpp: runs lcov --capture for gcov-style C/C++ coverage data

For tools that always write lcov.info inside a report directory, --lcov must point to a path ending in lcov.info.

Pass arguments to the underlying builder after --:

doublcov forge -- --exclude-tests --ir-minimum
doublcov vite -- --runInBand
doublcov pytest -- tests/unit
doublcov cargo-llvm-cov -- --workspace

Builder integrations are built into this CLI. Adding a new builder requires a code change in the repository.

Solidity

Foundry:

{
  "scripts": {
    "coverage": "doublcov forge -- --exclude-tests --ir-minimum",
    "coverage:ci": "doublcov forge --no-open -- --exclude-tests --ir-minimum"
  }
}

Hardhat:

{
  "scripts": {
    "coverage": "doublcov hardhat",
    "coverage:ci": "doublcov hardhat --no-open"
  }
}

From existing Hardhat LCOV:

npx hardhat coverage
doublcov build \
  --lcov coverage/lcov.info \
  --sources contracts \
  --out coverage/report

JavaScript And TypeScript

doublcov vite
doublcov jest
doublcov v8

v8 uses c8 around Node's built-in test runner. Or build from existing LCOV:

doublcov build \
  --lcov coverage/lcov.info \
  --sources src \
  --extensions ts,tsx,js,jsx,mts,cts,mjs,cjs,vue

Python, Rust, C, And C++

doublcov pytest
doublcov cargo-llvm-cov
doublcov cargo-tarpaulin
doublcov lcov-capture -- --rc branch_coverage=1

These builders assume the ecosystem coverage tool is installed in the project or environment: pytest-cov for Python, cargo-llvm-cov or cargo-tarpaulin for Rust, and lcov plus compiler-generated gcov data for C/C++.

Diagnostics

Attach parser-tagged diagnostics:

doublcov build \
  --diagnostic foundry-debug:coverage.debug \
  --diagnostic foundry-bytecode:coverage.bytecode

Foundry aliases:

doublcov forge --debug coverage.debug --bytecode coverage.bytecode

Themes And UI Hooks

Attach declarative report customization:

doublcov build \
  --customization doublcov.config.json \
  --theme ci-dark

Customization JSON can set "open" to control whether the generated index.html opens after build or builder commands. It can also set lcov, out, sources, extensions, history, and name defaults, plus themes and declarative UI hook metadata for report:header, report:summary, file:toolbar, and sidebar:panel.

The CLI automatically loads doublcov.config.json from the current working directory when it exists. Use --customization <path> to override the path. An explicitly supplied customization path must exist.

Local builds open by default. CI and the GitHub Action default to --mode static --no-open. Use --mode, --open, or --no-open to override that behavior for one run.

Builder command defaults resolve from CLI flags first, then doublcov.config.json, then project config such as package.json, foundry.toml, Hardhat source paths, Jest/Vitest/c8 config, .solcover.js, or pyproject.toml. When no report output is configured, Doublcov writes the report to a report directory next to the resolved LCOV file.

Output Hosting

Standalone reports can be opened directly from disk. Static reports are better for large projects and can be uploaded to GitHub Pages, GitLab Pages, Netlify, Vercel, Cloudflare Pages, object storage, or CI artifacts.

GitHub Action

For non-Node projects, use the repository action to download the standalone binary in CI:

- uses: doublesharp/doublcov@v0
  with:
    command: build
    args: --lcov coverage/lcov.info --sources src --out coverage/report

Use the moving major action ref for compatible action updates. Omit version to download the latest GitHub Release binary, or set version: v0.4.5 to pin the downloaded CLI binary for reproducible CI. The action passes --no-open by default. Add --open to args only when the workflow intentionally has a browser-capable environment.

Distribution

npm is the primary distribution channel for the CLI. Tagged GitHub Releases publish standalone binaries and checksums, the root GitHub Action wraps those binaries for any-language CI, and the Docker image is published for containerized workflows.

Additional docs:

版本与发布记录

@0xdoublesharp/doublcov 共发布 14 个版本,首次发布于 2026/04/25;过去 12 个月发布了 14 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.4.5latest2026/10/2417 天前
0.4.42026/09/121 个月前
0.4.32026/04/276 个月前
0.4.22026/04/276 个月前
0.4.12026/04/266 个月前
0.4.02026/04/266 个月前

关于 @0xdoublesharp/doublcov 的常见问题

@0xdoublesharp/doublcov 是什么?

Find what's missing with static LCOV coverage reports

如何安装 @0xdoublesharp/doublcov?

在项目目录运行 npm install @0xdoublesharp/doublcov,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 doublcov,可以用 npx doublcov 直接运行。

@0xdoublesharp/doublcov 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/0xdoublesharp__doublcov 是否存在。

@0xdoublesharp/doublcov 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@0xdoublesharp/doublcov 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@0xdoublesharp/doublcov 可以商用吗?

@0xdoublesharp/doublcov 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@0xdoublesharp/doublcov 的下载量有多少?

根据 npm 官方下载统计,@0xdoublesharp/doublcov 在 2026/10/04 – 2026/11/02 这 30 天内被下载 1,708 次,日均约 57 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@0xdoublesharp/doublcov 还在维护吗?

最新版本 0.4.5 发布于 2026/10/24(17 天前);至今共发布 14 个版本,其中过去 12 个月发布了 14 个;首次发布于 2026/04/25。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。