{"_id":"@belikenikola/wcag-audit","name":"@belikenikola/wcag-audit","dist-tags":{"latest":"1.1.0"},"versions":{"1.1.0":{"name":"@belikenikola/wcag-audit","version":"1.1.0","description":"WCAG 2.1 accessibility auditor — CLI + library. Actionable reports and prioritized to-do lists, powered by axe-core and Playwright.","type":"module","main":"./src/lib.js","exports":{".":"./src/lib.js","./package.json":"./package.json"},"bin":{"wcag-audit":"bin/wcag-audit.js"},"scripts":{"start":"node bin/wcag-audit.js","test":"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage","test:integration":"vitest run --config vitest.integration.config.js","lint":"eslint src tests","lint:fix":"eslint src tests --fix","format":"prettier --write .","prepublishOnly":"npm test"},"keywords":["accessibility","a11y","wcag","wcag2","audit","cli","axe-core","playwright"],"author":{"name":"belikenikola"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/belikenikola/accessibility-audit.git"},"homepage":"https://github.com/belikenikola/accessibility-audit#readme","bugs":{"url":"https://github.com/belikenikola/accessibility-audit/issues"},"publishConfig":{"access":"public"},"dependencies":{"@axe-core/playwright":"^4.11.3","axe-core":"^4.10.2","commander":"^12.1.0","handlebars":"^4.7.8","ora":"^8.1.1","playwright":"^1.59.1"},"devDependencies":{"@vitest/coverage-v8":"^2.1.8","eslint":"^9.17.0","prettier":"^3.4.2","vitest":"^2.1.8"},"engines":{"node":">=20.0.0"},"gitHead":"05219cfb2985d24d5531f15d7d25f02ee4980163","_id":"@belikenikola/wcag-audit@1.1.0","_nodeVersion":"25.8.0","_npmVersion":"11.11.0","dist":{"integrity":"sha512-rbD4gqvYWgGGeUh1YbtKj1cVshCQtLxxq5S612y+Lzkt7lak4xNYpMmKpVmcMT8bUF0+41qfpQhKoxFloSBsOA==","shasum":"959b5bb97cd0495b82b622d25a7265611103994d","tarball":"https://registry.npmjs.org/@belikenikola/wcag-audit/-/wcag-audit-1.1.0.tgz","fileCount":17,"unpackedSize":78095,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIESvWfTgcPTw6HmC+N5eoMOmTijIX5eVKAoeJqu98pZpAiBTadL2ywB4c7eN/se3y4kZsqzm/33qhi91TSvEfVnzHQ=="}]},"_npmUser":{"name":"belikenikola","email":"belikenikola@gmail.com"},"directories":{},"maintainers":[{"name":"belikenikola","email":"belikenikola@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/wcag-audit_1.1.0_1786183702510_0.4768632933884347"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-08T10:08:22.250Z","1.1.0":"2026-08-08T10:08:22.650Z","modified":"2026-08-08T10:08:22.857Z"},"maintainers":[{"name":"belikenikola","email":"belikenikola@gmail.com"}],"description":"WCAG 2.1 accessibility auditor — CLI + library. Actionable reports and prioritized to-do lists, powered by axe-core and Playwright.","homepage":"https://github.com/belikenikola/accessibility-audit#readme","keywords":["accessibility","a11y","wcag","wcag2","audit","cli","axe-core","playwright"],"repository":{"type":"git","url":"git+https://github.com/belikenikola/accessibility-audit.git"},"author":{"name":"belikenikola"},"bugs":{"url":"https://github.com/belikenikola/accessibility-audit/issues"},"license":"MIT","readme":"# wcag-audit\n\n[![npm](https://img.shields.io/npm/v/@belikenikola/wcag-audit.svg)](https://www.npmjs.com/package/@belikenikola/wcag-audit)\n\nA WCAG 2.1 accessibility auditor — **CLI and library**. Checks web pages against WCAG 2.1 (A/AA/AAA), generates JSON/HTML/Markdown reports, and produces prioritized to-do lists for remediation. Powered by [axe-core](https://github.com/dequelabs/axe-core) and [Playwright](https://playwright.dev/).\n\n## Features\n\n- **WCAG 2.1 Compliance Testing** — Test against Level A, AA, or AAA\n- **Multiple Output Formats** — JSON, HTML, and Markdown reports\n- **Prioritized To-Do Lists** — Actionable remediation tasks sorted by impact\n- **Auth Detection** — Automatically detects login walls and protected pages\n- **CI/CD Ready** — Exit codes for automation pipelines\n- **Library API** — Import `runAudit`/`generateReport` into your own tooling, with a pluggable browser launcher for serverless\n\n## Installation\n\n```bash\nnpm install -g @belikenikola/wcag-audit\n\n# Playwright's Chromium is required at runtime (one-time, ~150–300MB)\nnpx playwright install chromium\n```\n\nOr run without installing:\n\n```bash\nnpx @belikenikola/wcag-audit https://example.com\n```\n\n> **Note:** No `postinstall` hook is bundled (that would be user-hostile for a library dependency). Install the Chromium binary yourself once with `npx playwright install chromium`.\n\n## Quick Start\n\n```bash\n# Basic audit (defaults to WCAG AA, JSON output)\nwcag-audit https://example.com\n```\n\n## Usage\n\n```\nwcag-audit <url> [options]\n\nArguments:\n  url                  URL to audit\n\nOptions:\n  -l, --level <level>  WCAG conformance level: A, AA, or AAA (default: \"AA\")\n  -f, --format <fmt>   Output format: json, html, or md (default: \"json\")\n  -o, --output <path>  Output file path (default: auto-generated)\n  -t, --timeout <ms>   Page load timeout in milliseconds (default: \"30000\")\n  -v, --verbose        Enable verbose logging (default: false)\n  -h, --help           Display help\n  --version            Display version\n```\n\n## Examples\n\n```bash\n# Different WCAG levels\nwcag-audit https://example.com --level A\nwcag-audit https://example.com --level AAA\n\n# Output formats\nwcag-audit https://example.com --format html\nwcag-audit https://example.com -f html -o ./reports/audit.html\n\n# Verbose progress\nwcag-audit https://example.com --verbose\n```\n\n## Exit Codes\n\n| Code | Meaning |\n|------|---------|\n| 0 | Success — no violations found |\n| 1 | Success — violations found |\n| 2 | URL requires authentication |\n| 3 | Invalid input (URL, options) |\n| 4 | Unexpected error |\n\n### CI/CD Integration\n\n```bash\nwcag-audit https://staging.example.com --format json -o report.json\n\nif [ $? -eq 1 ]; then\n  echo \"Accessibility violations found!\"\n  # Upload report as artifact, notify team, etc.\nfi\n```\n\n## Report Contents\n\n**Summary** — accessibility score (0–100%), violation count, items needing manual review, and passing checks.\n\n**To-Do List** — each item includes a priority (ranked by impact and effort), a clear remediation task, related WCAG success criteria, the count of affected DOM nodes, and an effort estimate (Low / Medium / High).\n\n**Violation Details** — rule ID and description, impact level (critical / serious / moderate / minor), WCAG success criteria, affected elements with selectors and HTML, and links to documentation.\n\n## WCAG Level Coverage\n\n| Level | Description | Criteria |\n|-------|-------------|----------|\n| **A** | Minimum accessibility | ~30 criteria |\n| **AA** | Standard compliance (recommended) | ~50 criteria |\n| **AAA** | Enhanced accessibility | ~78 criteria |\n\n## Programmatic Usage\n\nThe package root exposes the public library API:\n\n```javascript\nimport { runAudit, generateReport, saveReport, buildTodoList, shutdown } from '@belikenikola/wcag-audit';\n\nconst result = await runAudit('https://example.com', { level: 'AA', timeout: 30000 });\n\nif (result.success) {\n  const todos = buildTodoList(result.violations);\n  console.log('To-do items:', todos.length);\n\n  const html = generateReport(result, 'html');\n  await saveReport(result, 'report.html', 'html');\n}\n\nawait shutdown();\n```\n\n### Serverless / custom Chromium\n\nInject your own browser launcher (e.g. `playwright-core` + `@sparticuz/chromium` on Vercel/Lambda) so you don't have to ship full Playwright:\n\n```javascript\nimport { setBrowserLauncher, runAudit, shutdown } from '@belikenikola/wcag-audit';\nimport { chromium } from 'playwright-core';\nimport chromiumBin from '@sparticuz/chromium';\n\nsetBrowserLauncher(async () => chromium.launch({\n  args: chromiumBin.args,\n  executablePath: await chromiumBin.executablePath(),\n  headless: true,\n}));\n\nconst result = await runAudit('https://example.com');\nawait shutdown();\n```\n\n## Limitations\n\n- **JavaScript-rendered content**: Playwright waits for network idle, but highly dynamic SPAs may need longer timeouts.\n- **Authentication**: Pages requiring login are detected and skipped.\n- **Automated coverage**: ~50% of WCAG criteria can be fully automated; some require manual review.\n- **Single page**: Currently audits one URL at a time.\n\n## Technology Stack\n\n- **[Playwright](https://playwright.dev/)** — Browser automation\n- **[axe-core](https://github.com/dequelabs/axe-core)** — Accessibility testing engine\n- **[Commander.js](https://github.com/tj/commander.js/)** — CLI framework\n- **[Handlebars](https://handlebarsjs.com/)** — HTML templating\n- **[Vitest](https://vitest.dev/)** — Testing framework\n\n## Development\n\n```bash\ngit clone https://github.com/belikenikola/accessibility-audit.git\ncd accessibility-audit\nnpm install\nnpx playwright install chromium\n\nnpm test                  # unit tests\nnpm run test:coverage     # with coverage\nnpm run test:integration  # integration tests (requires Playwright)\nnpm run lint\n```\n\n## License\n\nMIT — see [LICENSE](./LICENSE).\n\n## Resources\n\n- [WCAG 2.1 Guidelines](https://www.w3.org/WAI/WCAG21/quickref/)\n- [axe-core Rules](https://dequeuniversity.com/rules/axe/)\n- [WebAIM Contrast Checker](https://webaim.org/resources/contrastchecker/)\n","readmeFilename":"README.md","_rev":"1-491290ff142a7afdb1b727f2bbce8a25"}