Skip to content

NickCirv/access-check

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Banner

access-check

Your website isn't accessible. Here's exactly what to fix.

npm WCAG 2.2 No browser needed Works offline


The Problem

1 in 4 adults has a disability. Your website probably doesn't work for them.

The EU Accessibility Act is now law. US accessibility lawsuits are up 300% in the last 3 years. And most dev teams have no idea where to start.

Other tools need a browser. Lighthouse needs Chrome. axe needs a runtime. This tool audits raw HTML — works in CI pipelines, on build artifacts, even offline. No headless browser. No setup.


Quick Start

npx access-check index.html

No install required.


Sample Output

  ACCESS-CHECK  v1.0.0  (WCAG 2.2 Level AA)

  Checking index.html...

  ── Critical ─────────────────────────────────
  ✗  Images missing alt attribute  ×3                   WCAG 1.1.1
     <img src="hero.jpg"> (line 23)
     <img src="logo.png"> (line 5)
     <img src="banner.webp"> (line 67)
     Fix: Add descriptive alt text to each <img>. For decorative images, use alt="".

  ✗  Form inputs without associated labels  ×2          WCAG 1.3.1
     <input type="email"> (line 45)
     <input type="text"> (line 52)
     Fix: Add <label for="inputId"> matching the input id, or add aria-label.

  ── Serious ──────────────────────────────────
  !  <html> element missing lang attribute              WCAG 3.1.1
     Fix: Add lang="en" (or appropriate language) to <html>.

  !  Heading levels are skipped                         WCAG 1.3.1
     Heading level skipped: h1 → h3
     Fix: Use sequential heading levels (h1, h2, h3...).

  ── Warnings ─────────────────────────────────
  ~  Links with generic or meaningless text  ×1         WCAG 2.4.4
     Link text "Click here" is too generic
     Fix: Use descriptive link text (e.g., "View pricing plans").

  ~  Page missing skip navigation link                  WCAG 2.4.1
     Fix: Add <a href="#main" class="skip-link">Skip to main content</a>.

  ── Summary ──────────────────────────────────
  2 critical │ 2 serious │ 2 warnings │ 0 info

  WCAG AA: FAIL (critical or serious issues must be resolved)

Commands

# Audit a single HTML file
access-check index.html

# Audit all HTML files in a directory
access-check ./dist/

# Audit a live URL
access-check https://example.com

# Set WCAG conformance level
access-check index.html --level AA

# Output as Markdown (for reports or tickets)
access-check index.html --format md

# Output as JSON (for programmatic use)
access-check index.html --json

# CI mode — exit code 1 on any violation
access-check index.html --strict

# Only report serious issues and above
access-check index.html --min-severity serious

What It Checks

30+ rules across 5 categories:

Category Rules
Images & Media Missing alt text, empty alt on non-decorative images, SVG labels, video captions, audio transcripts, iframe titles
Structure & Semantics Missing h1, skipped heading levels, html lang, page title, table headers, landmark regions, form labels, viewport zoom
Navigation Links without href, generic link text, skip link, positive tabindex, onClick on non-interactive elements, empty links
Forms Missing labels, autocomplete attributes, aria-required on required fields, password field autocomplete
ARIA Invalid roles, aria-hidden on focusable elements, duplicate IDs, icon buttons without labels, broken aria-labelledby/describedby references, empty buttons

WCAG Levels

Level What it means
A Minimum. Fail this and your site is actively broken for assistive tech users.
AA (default) Standard compliance level. Required by EU Accessibility Act and most legal standards.
AAA Enhanced. Some criteria are not achievable for all content — aspirational for most sites.

CI Integration

Fail your build on accessibility regressions:

# GitHub Actions
- name: Accessibility audit
  run: npx access-check ./dist/ --level AA --strict
# Pre-commit hook
npx access-check index.html --strict && echo "Accessibility check passed"

Exit codes:

  • 0 — No critical or serious violations
  • 1 — Violations found (or any violation in --strict mode)

Why Not axe or Lighthouse?

Tool Requires Works in CI without setup
access-check Node.js 18+ Yes
axe Browser runtime No — needs jsdom or puppeteer
Lighthouse Chrome No — needs headless Chrome
Pa11y Chrome or PhantomJS No — needs browser binary

access-check parses raw HTML. No browser binary. No headless overhead. Works on:

  • Static HTML files
  • React build output (dist/)
  • Vue / Svelte / Astro build artifacts
  • Server-rendered HTML snapshots
  • Any HTML output from any framework

Install Globally

npm install -g access-check
access-check index.html

License

MIT — Nicholas Ashkar, 2026

Releases

No releases published

Packages

 
 
 

Contributors