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

kouma-client

v1.0.6

Published

Kouma visual regression testing client — CLI & library

Downloads

401

Readme

kouma

TypeScript client and CLI for Kouma visual regression testing.

Upload screenshots, trigger builds, and query build results — as a library or from the command line.

Install

npm install kouma-client

Library Usage

import { KoumaClient } from "kouma";

const client = new KoumaClient({
  host: "https://kouma.example.com",
  apiKey: "your-api-key",
});

Upload screenshots and create a build (async)

Screenshots are uploaded one-by-one, then the build is initialized and comparison runs asynchronously on the server.

const build = await client.newBuild({
  pid: "project-id",
  buildVersion: "abc1234",
  screenshotsDirectory: "./screenshots",
  metadata: { branch: "main", env: "ci" },
});

if (build) {
  console.log(`Build ${build.bid} created (index: ${build.buildIndex})`);
}

Upload and build in a single request (sync)

All screenshots are sent in one multipart request. The server uploads, initializes, and compares synchronously.

const result = await client.newBuildSync({
  pid: "project-id",
  buildVersion: "abc1234",
  screenshotsDirectory: "./screenshots",
});

if (result) {
  console.log(`${result.status} — ${result.result}`); // "completed — passed"
}

Query build statistics

// By build ID
const stats = await client.getBuildStats("build-id");
console.log(stats.status, stats.result);

// Latest build for a project
const latest = await client.getLatestBuildStats("project-id");
console.log(`Build #${latest.index}: ${latest.result}`);

CLI Usage

The kouma binary is available after installation.

# Upload screenshots and trigger a build (async)
kouma new-build \
  --host https://kouma.example.com \
  --api-key abc123 \
  --pid project-id \
  --build-version v1.0 \
  --screenshots-dir ./screenshots \
  --meta branch=main --meta env=ci

# Upload and build in a single request (sync)
kouma new-build-sync \
  --host https://kouma.example.com \
  --api-key abc123 \
  --pid project-id \
  --build-version v1.0 \
  --screenshots-dir ./screenshots

# Get build statistics
kouma build-stats --host https://kouma.example.com --api-key abc123 --bid build-id

# Get latest build statistics for a project
kouma latest-build-stats --host https://kouma.example.com --api-key abc123 --pid project-id

Environment Variables

| Variable | Description | | --- | --- | | KOUMA_HOST | Default for --host | | KOUMA_API_KEY | Default for --api-key | | KOUMA_PID | Default for --pid |

Cypress Plugin

// cypress.config.ts
import { createCypressPlugin } from "kouma/cypress";

export default defineConfig({
  e2e: {
    setupNodeEvents(on) {
      createCypressPlugin(on, {
        host: "https://kouma.example.com",
        apiKey: "your-api-key",
        pid: "project-id",
        buildVersion: process.env.GIT_SHA ?? "local",
      });
    },
  },
});

Plugin Options

| Option | Default | Description | | --- | --- | --- | | triggerVisualTesting | true | Trigger visual testing after the run | | triggerOnAllPassed | true | Only trigger if all tests passed | | removeScreenshotsAfterUpload | true | Clean up screenshots after upload |

Supported Image Formats

The client accepts screenshots in any format supported by the Kouma engine:

.png, .jpg, .jpeg, .bmp, .webp, .gif

Filename Validation

Screenshot filenames are validated client-side before upload:

  • Must have a supported image extension
  • Maximum 255 characters (including extension)
  • Cannot contain: < > : " / \ | ? * or null bytes

License

MIT