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

@kiwa-lab/a11y

v2.0.0

Published

Accessibility (a11y) test adapter for kiwa — axe-core integration for jsdom + Playwright pages

Downloads

21

Readme

@kiwa-lab/a11y

Accessibility (a11y) test adapter for the kiwa framework. Thin wrapper around axe-core that plugs into Vitest + jsdom and Playwright page contexts.

Install

pnpm add -D @kiwa-lab/a11y axe-core
# Playwright も使う場合
pnpm add -D @playwright/test

axe-core は peer/optional 扱い、 必ず一緒に install してください。

Quickstart — jsdom + Vitest

import { describe, expect, it } from 'vitest';
import { runAxe, expectNoViolations } from '@kiwa-lab/a11y';

describe('Counter component', () => {
  it('has no critical / serious a11y violations', async () => {
    document.body.innerHTML = '<button aria-label="increment">+</button>';

    const results = await runAxe();
    expectNoViolations(results, expect, { maxImpact: 'serious' });
  });
});

vitest.config.tsenvironment: 'jsdom' を指定すること。

Quickstart — Playwright page

runAxe は jsdom 専用です。 Playwright page を audit するときは page 内で axe.run() を直接 evaluate して結果を取得し、 reportViolations で集計します。

import { test, expect } from '@playwright/test';
import { reportViolations } from '@kiwa-lab/a11y';

test('home is accessible', async ({ page }) => {
  await page.goto('/');
  await page.addScriptTag({ url: 'https://unpkg.com/axe-core@4/axe.min.js' });
  const results = await page.evaluate(async () => await (window as any).axe.run());

  const report = reportViolations(results, { maxImpact: 'serious' });
  expect(report.blocking, report.summary).toEqual([]);
});

API

| 関数 | 用途 | |---|---| | runAxe(opts?) | jsdom 環境で axe.run() 実行、 AxeResults を返す | | reportViolations(results, { maxImpact }) | maxImpact (minor / moderate / serious / critical) 以上の violation を blocking として抽出、 サマリ文字列を生成 | | expectNoViolations(results, expect, { maxImpact }) | blocking 0 件を expect(...).toBe(0) で assert、 失敗時に詳細メッセージ throw |

AuditOptions

interface AuditOptions {
  context?: Element | Document | string;   // default: document
  runOptions?: Parameters<typeof axe.run>[1];
  maxImpact?: 'minor' | 'moderate' | 'serious' | 'critical';  // default: 'minor'
}

Impact levels

axe-core の impact 4 段階 (minor < moderate < serious < critical) と一致。 maxImpact: 'serious' は serious と critical を blocking 扱い。

ライセンス

MIT