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-modern-reporter

v1.0.5

Published

A modern reporter for k6

Readme

k6-modern-reporter

A modern, beautiful HTML report generator for k6 performance tests with an interactive UI, responsive design, and comprehensive metrics visualization.

Features

Modern UI Design

  • Gradient backgrounds and smooth animations
  • Responsive layout that works on all devices
  • Interactive tabbed interface
  • Professional color scheme with intuitive visual indicators

📊 Comprehensive Metrics

  • Performance overview with key statistics
  • Detailed HTTP request metrics (duration, waiting, connecting, TLS, etc.)
  • Data transfer statistics (sent/received)
  • Request success/failure rates
  • P90, P95, and percentile breakdowns

Test Validation

  • Visual check results with pass/fail counts
  • Threshold status and validation results
  • Overall test status indicator
  • Detailed error tracking

🎯 Customizable Reports

  • Custom titles and subtitles
  • HTTP method display
  • Additional test information sections
  • Debug mode for troubleshooting

Installation

Direct Import Raw

Add the following import like this in any ts file:

// @ts-ignore
import { htmlReport } from 'https://raw.githubusercontent.com/Samin005/k6-modern-reporter/refs/heads/main/k6-modern-reporter.js';

Using NPM and esbuild

  1. Run npm i k6-modern-reporter into your k6 project

  2. Import htmlReport in your script:

    import { htmlReport } from './node_modules/k6-modern-reporter/k6-modern-reporter.js';

    Note: since k6 does not support npm packages by default (as k6 runs using go), remember to include the entire relative path in the import like shown above.

  3. Example: let's say we have a test.ts (or test.js, works for both .ts and .js) with k6 tests:

    import http from 'k6/http';
    import { htmlReport } from './node_modules/k6-modern-reporter/k6-modern-reporter.js';
    
    export const options = {
        scenarios: {
            shared_iteration: {
                executor: 'shared-iterations',
                vus: 50,
                iterations: 100,
                maxDuration: '60s',
            }
        }
    };
    
    export default function () {
        const response = http.get("https://quickpizza.grafana.com");
    }
    
    // Generate the modern HTML report
    export function handleSummary(data) {
        const reportFileName = `./test-report-${new Date().toJSON().split(':').join('-')}.html`;
        return {
            [reportFileName]: htmlReport(data)
        };
    }

    We can run this file with k6:

    k6 run test.ts

Usage

Basic Setup

Example of a k6 test script:

import http from 'k6/http';
import { check } from 'k6';
// @ts-ignore
import { htmlReport } from 'https://raw.githubusercontent.com/Samin005/k6-modern-reporter/refs/heads/main/k6-modern-reporter.js';

export const options = {
    scenarios: {
        shared_iteration: {
            executor: 'shared-iterations',
            vus: 50,
            iterations: 100,
            maxDuration: '60s',
        }
    },
    thresholds: {
        'http_req_failed': ['rate==0.00'],
        'http_req_duration': ['p(95)<1000'],
        'checks': ['rate==1.00'],
    },
};

export default function () {
    const response = http.get("https://httpbin.org/get");
    
    check(response, {
        'Response status 200': (r) => r.status === 200,
    });
}

// Generate the HTML report
export function handleSummary(data) {
    const reportFileName = `./test-report-${new Date().toJSON().split(':').join('-')}.html`;
    return {
        [reportFileName]: htmlReport(data)
    };
}

Report Layout

The generated HTML report includes the following sections, accessible via interactive tabs:

📈 Overview Tab (Default)

K6 Report Overview

Performance Overview

  • Total Requests counter
  • Success Rate percentage
  • Failed Requests count
  • Overall Test Status (PASS/FAIL indicator)

Data Transfer

  • Bytes received across all requests
  • Bytes sent across all requests
  • Avg request size
  • Total data transferred

📊 Metrics Tab

K6 Report Overview

Detailed HTTP request metrics table showing:

  • http_req_duration: Total request time (Avg, Min, Median, Max, P90, P95)
  • http_req_waiting: Server processing time
  • http_req_connecting: TCP connection establishment time
  • http_req_tls_handshaking: TLS/SSL handshake time
  • http_req_receiving: Response download time
  • http_req_sending: Request upload time

Color-coded values:

  • 🟢 Green: Good performance metrics
  • 🔴 Red: Poor performance metrics

✅ Checks Tab

K6 Report Overview

Displays all test checks organized by groups with:

  • Check name and description
  • Pass count (green badge)
  • Fail count (red badge)
  • Pass/Fail rate percentage

🎯 Thresholds Tab

K6 Report Overview

Shows threshold validation results:

  • Threshold condition (e.g., p(95)<1000, rate==0.00)
  • Actual value achieved
  • Pass/Fail status with color coding

📝 Testing it out locally

Clone the repo and run:

npm test

API Reference

htmlReport(data, options)

Generates and returns a complete HTML document as a string.

Parameters:

  • data (Object): The k6 test results data object containing metrics, checks, and thresholds
  • options (Object): Configuration options
    • title (string): Main report title - defaults to current timestamp
    • subtitle (string): Subtitle or endpoint description
    • httpMethod (string): HTTP method used (GET, POST, PUT, DELETE, etc.)
    • additionalInfo (Object): Key-value pairs of custom test information
    • debug (boolean): If true, logs raw k6 data to console

Returns:

  • (string): Complete HTML document

License

MIT License. See LICENSE file for details.