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

k6-clean-report

v0.1.0

Published

Generate clean, non-technical HTML reports from k6 performance test JSON output

Readme

k6-clean-report

Generate clean, readable HTML reports from k6 performance test JSON output. Designed for sharing results with non-technical stakeholders.

Install

npm install -g k6-clean-report

Or as a project dev dependency:

npm install --save-dev k6-clean-report

Quick Start

Step 1: Export k6 results to JSON by adding this to your handleSummary function:

export function handleSummary(data) {
  return {
    stdout: textSummary(data, { indent: ' ', enableColors: true }),
    'k6-results.json': JSON.stringify(data),
  };
}

Step 2: Generate the report after your test runs:

k6-clean-report k6-results.json --test load --env staging

This produces a self-contained HTML file: load-staging-20260506102345-performance-report.html

CLI Options

k6-clean-report <input.json> [options]

Options:
  --test   <name>   Test type label: smoke, load, stress, soak, spike, breakpoint
  --env    <name>   Environment label: dev, staging, prod
  --target <url>    URL of the system under test
  --output <file>   Output file path (overrides auto-generated name)
  --help            Show help

If --test or --env are not provided, the tool attempts to guess them from the input filename.

Node.js API

const { generateReport } = require('k6-clean-report');
const fs   = require('fs');
const data = JSON.parse(fs.readFileSync('k6-results.json', 'utf8'));

const html = generateReport(data, {
  testName: 'load',
  env: 'staging',
  target: 'https://api.example.com',
});

fs.writeFileSync('report.html', html);

What the Report Shows

| Section | What it contains | |---|---| | Executive Summary | Pass/fail verdict, error rate, failing goals | | Test Configuration | Environment, target URL, duration, RPS, iterations | | Performance Goals | All thresholds with PASS/FAIL status | | At a Glance | 95th percentile bar chart by scenario or page (if tagged) | | Response Times | Min, average, median, 90th/95th/99th percentile | | Request Time Breakdown | Time spent per phase: queued, connecting, TLS, sending, waiting, receiving | | Iteration and Group Timing | Full iteration duration and named group() durations | | Breakdown by Scenario / Page | Per-scenario response times and error rates (if tagged) | | Application Metrics | Custom metrics defined in your test script | | Detailed Metrics | All metrics with full statistics, grouped by type | | Quality Checks | All check() results with pass/fail counts |

The report is fully self-contained (no CDN dependencies) and print-ready.

Scenario and Page Breakdown

The "At a Glance" and "Breakdown by Scenario / Page" sections appear automatically when your test uses tagged requests:

// Multiple named scenarios (k6 options)
export const options = {
  scenarios: {
    browse: { executor: 'constant-vus', vus: 10, duration: '5m' },
    checkout: { executor: 'constant-vus', vus: 5, duration: '5m' },
  },
};

// Or tagged requests
http.get(url, { tags: { page: 'homepage' } });
http.post(url, body, { tags: { page: 'checkout' } });

Custom Metrics

Custom metrics defined in your test script appear in the "Application Metrics" section:

import { Trend, Rate, Counter, Gauge } from 'k6/metrics';

const checkoutDuration = new Trend('checkout_duration');
const loginSuccessRate = new Rate('login_success_rate');

Chaining with npm Scripts

{
  "scripts": {
    "test:load": "k6 run script.js && k6-clean-report k6-results.json --test load --env staging --target https://api.example.com"
  }
}

License

MIT