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

wcag-query

v0.1.0

Published

Programmatic access to WCAG 2.2 Success Criteria, Techniques, and Failures.

Readme

wcag-query

Programmatic access to WCAG 2.2 Success Criteria, Sufficient Techniques, and Failures. Analogous to aria-query and apg-query but for WCAG.

The W3C publishes WCAG 2.2 as HTML pages — this package extracts the structured content into JS-queryable data so tools (linters, MCP servers, audit reporters, doc generators) can consume it without scraping at runtime.

Install

npm install wcag-query

Usage

import {
  getSC, getTechnique, getFailure, search,
  successCriteria, techniques, failures,
  WCAG_VERSION, WCAG_SNAPSHOT,
} from 'wcag-query'

// Substring search over id/title/statement, with an optional cumulative level filter:
search('focus', { level: 'AA' })   // → AA-and-below SCs mentioning "focus"

const sc = getSC('2.4.7')
console.log(sc.title)            // 'Focus Visible'
console.log(sc.level)            // 'AA'
console.log(sc.short_text)       // verbatim SC statement
console.log(sc.technique_ids)    // ['G149', 'C15', 'G165', ...]
console.log(sc.failure_ids)      // ['F55', 'F78']

const f78 = getFailure('F78')
console.log(f78.title)           // 'Failure of Success Criterion 1.4.11, 2.4.7 and 2.4.13...'
console.log(f78.applicable_sc_ids) // ['2.4.7', ...]
console.log(f78.url)             // canonical W3C URL

Data shapes

interface SuccessCriterion {
  id: string                       // '2.4.7'
  level: 'A' | 'AA' | 'AAA'
  title: string                    // 'Focus Visible'
  short_text: string               // verbatim SC statement
  understanding_url: string
  technique_ids: string[]          // ['G149', 'C15', ...]
  failure_ids: string[]            // ['F55', 'F78']
}

interface Technique {
  id: string                       // 'G149', 'F78', etc.
  kind: 'sufficient' | 'advisory' | 'failure'
  title: string                    // verbatim
  applicable_sc_ids: string[]      // SCs this technique applies to
  url: string
}

Coverage

Ships all 86 WCAG 2.2 Success Criteria (WCAG 2.2 removed 4.1.1 Parsing, leaving 86), 316 techniques, and 89 failures. Refreshing against upstream errata is mechanical — re-run the extractor.

Methodology

Data is extracted from snapshotted W3C "Understanding" pages. The extractor (tools/extract.ts) parses each page's structured sections (#success-criterion for the SC text, #sufficient for techniques, #failure for failures) and writes JSON to src/data/.

To refresh against current WCAG content:

npm run extract -- --refresh

This re-fetches each Understanding page, updates snapshots/, and re-runs extraction. The diff is reviewable before commit.

Provenance and licensing

Data is derived from W3C WCAG 2.2 Understanding pages, licensed under the W3C Document License (BSD-style, permits redistribution with attribution). See NOTICE. The extraction code is MIT-licensed.

Related

  • aria-query — WAI-ARIA roles, properties, element-role mappings
  • apg-query — APG patterns (button, dialog, tabs, ...)

Data versions

Each published version ↔ the upstream snapshot it was built from.

| Version | Scraped | WCAG | | --- | --- | --- | | 0.1.0 | 2026-05-07 | 2.2 |