npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

coverage-single-html

v0.1.4

Published

Convert Istanbul/Vitest coverage HTML reports into a single self-contained HTML file

Readme

coverage-single-html

Convert Istanbul/Vitest coverage HTML reports into a single self-contained HTML file.

Perfect for:

  • Sharing coverage reports via email or Slack
  • Attaching to pull requests or issues
  • Archiving coverage snapshots
  • Viewing reports without a web server

Installation

npm install -D coverage-single-html

Or run directly with npx:

npx coverage-single-html coverage/lcov-report -o report.html

Usage

CLI

# Basic usage - outputs to coverage-report.html
coverage-single-html coverage/merged

# Specify output file
coverage-single-html coverage/lcov-report -o my-report.html

# Custom title
coverage-single-html coverage -t "My Project Coverage" -o coverage.html

Options

Arguments:
  <input-dir>    Directory containing Istanbul/Vitest HTML coverage report

Options:
  -o, --output   Output file path (default: coverage-report.html)
  -t, --title    Custom title for the report
  -h, --help     Show help message
  -v, --version  Show version

Programmatic API

import { bundleCoverage } from 'coverage-single-html'
import { writeFileSync } from 'fs'

const result = bundleCoverage({
  inputDir: 'coverage/lcov-report',
  title: 'My Coverage Report',
})

writeFileSync('report.html', result.html)

console.log(`Bundled ${result.fileCount} files`)
console.log(`Total size: ${result.totalSize} bytes`)

Supported Coverage Tools

Works with any tool that generates Istanbul-style HTML reports:

  • Vitest (@vitest/coverage-v8)
  • Jest (jest --coverage)
  • nyc/Istanbul (nyc report --reporter=html)
  • c8 (c8 report --reporter=html)

Features

  • Single file output - All HTML, CSS, JS, and images bundled into one file
  • Sidebar navigation - Browse files with a collapsible folder tree
  • Keyboard navigation - Press n/j for next uncovered, b/p/k for previous
  • Mobile responsive - Works on phones and tablets
  • No dependencies - Zero runtime dependencies

Demo

View a sample coverage report generated from a real project (62 files bundled into a single 662KB HTML file).

Example

# Generate coverage with Vitest
npm run test -- --coverage

# Bundle into single file
npx coverage-single-html coverage -o coverage-report.html

# Open in browser
open coverage-report.html  # macOS
start coverage-report.html # Windows

How It Works

  1. Reads all HTML files from the coverage directory
  2. Extracts and inlines CSS and JavaScript
  3. Converts images to base64 data URLs
  4. Builds a sidebar navigation tree
  5. Outputs a single self-contained HTML file

License

MIT