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

@gamut-all/audit

v0.1.1

Published

CI audit tooling for gamut-all design tokens

Readme

@gamut-all/audit

CI tooling for @gamut-all/core design tokens. Audits every token variant for compliance, scans the DOM for misconfigured theme and stack attributes, and produces coverage reports showing which steps pass at each font size.

Installation

npm install @gamut-all/audit @gamut-all/core

For auditURL (Playwright-based DOM auditing), also install Playwright as a peer:

npm install playwright

CLI

gamut-audit --registry ./dist/tokens.js [options]

| Flag | Default | Description | |------|---------|-------------| | --registry | (required) | Path to a JS/TS file that exports TokenRegistry | | --html | — | HTML file or URL to scan with auditDOM | | --engine | wcag21 | wcag21 or apca | | --level | AA | AA or AAA | | --format | text | text or json | | --report | audit | audit or coverage | | --font-size | 16 | Font size (px) used for coverage report |

Exit code is 0 when there are no errors, 1 when errors are found.

Programmatic API

auditRegistry(registry, engine, level?)

Checks every variant in the registry against the compliance engine. Fails on non-compliant resolved steps (surface utility tokens included).

import { auditRegistry, formatText } from '@gamut-all/audit';
import { wcag21 } from '@gamut-all/core';

const result = auditRegistry(registry, wcag21, 'AA');
console.log(formatText(result));

if (result.failCount > 0) process.exit(1);

auditDOM(root, registry, options?)

Scans a live DOM tree for attribute errors:

  • unknown-themedata-theme value not present in the registry
  • missing-data-theme — element with token CSS vars but no data-theme ancestor
  • unknown-surfacedata-bg value not in registry.surfaces
  • missing-data-stack (warning) — contextual element with no data-stack
  • unknown-token-var — CSS var(--fg-*) reference to an unknown token
import { auditDOM, formatText } from '@gamut-all/audit';

const result = auditDOM(document.body, registry);
console.log(formatText(result));

auditURL(url, registry, options?)

Launches a Playwright browser, navigates to url, and runs auditDOM against the rendered page. Requires playwright as a peer dependency.

import { auditURL, formatJSON } from '@gamut-all/audit';

const result = await auditURL('https://localhost:3000', registry, {
  width: 1280,
  height: 720,
  browser: 'chromium', // 'chromium' | 'firefox' | 'webkit'
});

console.log(formatJSON(result));

auditCoverage(registry, engine, level?, opts?)

For each token and each background, reports the full range of steps that pass compliance and where the configured step falls within that range. Useful for designers checking step choices.

import { auditCoverage, formatCoverageText } from '@gamut-all/audit';
import { wcag21 } from '@gamut-all/core';

const report = auditCoverage(registry, wcag21, 'AA', { fontSizePx: 16 });
console.log(formatCoverageText(report));

Result types

AuditResult

interface AuditResult {
  issues: AuditIssue[];
  variantsChecked: number;
  elementsChecked: number;
  passCount: number;
  failCount: number;
}

interface AuditIssue {
  type: IssueType;
  severity: 'error' | 'warning';
  token?: string;
  element?: string;      // CSS selector path (DOM audits)
  message: string;
  context?: Record<string, unknown>;
}

type IssueType =
  | 'non-compliant-variant'
  | 'non-compliant-surface-token'
  | 'unknown-theme'
  | 'missing-data-theme'
  | 'unknown-surface'
  | 'missing-data-stack'
  | 'unknown-token-var';

CoverageReport

interface CoverageReport {
  tokens: TokenCoverage[];
  meta: {
    engine: string;
    level: 'AA' | 'AAA';
    fontSize: string;
    generatedAt: string;
  };
}

Formatters

import {
  formatText,        // Human-readable audit result
  formatJSON,        // Machine-readable audit result
  formatCoverageText, // Tabular coverage report
  formatCoverageJSON, // JSON coverage export
} from '@gamut-all/audit';

CI example

# .github/workflows/tokens.yml
- name: Audit tokens
  run: |
    node -e "
      import('@gamut-all/audit').then(async ({ auditRegistry, formatText }) => {
        const { registry } = await import('./dist/tokens.js');
        const { wcag21 } = await import('@gamut-all/core');
        const result = auditRegistry(registry, wcag21, 'AA');
        console.log(formatText(result));
        process.exit(result.failCount > 0 ? 1 : 0);
      });
    "