{"_id":"@belenkadev/be-a11y","_rev":"2-65d6d0ba4afe4c316f9a8a4db7c26e99","name":"@belenkadev/be-a11y","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@belenkadev/be-a11y","version":"1.0.0","keywords":["js","web-accesibility","a11y"],"author":{"name":"BeLenka X Barebarics"},"license":"MIT","_id":"@belenkadev/be-a11y@1.0.0","maintainers":[{"name":"be-lenka","email":"dev+npm@belenka.com"}],"homepage":"https://github.com/be-lenka/be-a11y#readme","bugs":{"url":"https://github.com/be-lenka/be-a11y/issues"},"bin":{"be-a11y":"index.js"},"dist":{"shasum":"3bed1eb96167170d3d78ab9b1eea8fbcfdd45dc3","tarball":"https://registry.npmjs.org/@belenkadev/be-a11y/-/be-a11y-1.0.0.tgz","fileCount":6,"integrity":"sha512-9/2UJtRaeF2wAKDQYqO98csXsOmGvvqomliX1R9saxCnWR19n7SP/FjZklycTKRpSf3s//0EytvOlLV7mCVyJQ==","signatures":[{"sig":"MEUCIQDIYec7qZu6kNOBXjfcL8TYaXLEJcSRKNTdTMbcxuhQkAIgNMi9VBntIez7oSqHTz1ipDBoo4I/tToGQ88WjJVo4as=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26147},"main":"check-headings-order.js","type":"commonjs","gitHead":"846ae97c273c668e710f11de63ef3174400c3eab","scripts":{"test":"npm install"},"_npmUser":{"name":"be-lenka","email":"dev+npm@belenka.com"},"repository":{"url":"git+https://github.com/be-lenka/be-a11y.git","type":"git"},"_npmVersion":"10.7.0","description":"Web accesibility tools","directories":{"doc":"docs"},"_nodeVersion":"18.20.3","dependencies":{"css":"^3.0.0","chalk":"^4.1.2","be-a11y":"github:be-lenka/be-a11y","cheerio":"^1.0.0","node-fetch":"^2.7.0","tinycolor2":"^1.6.0"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/be-a11y_1.0.0_1749725281273_0.48454687131233753","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-06-12T10:48:01.191Z","modified":"2025-06-12T14:39:47.988Z","1.0.0":"2025-06-12T10:48:01.460Z"},"bugs":{"url":"https://github.com/be-lenka/be-a11y/issues"},"author":{"name":"BeLenka X Barebarics"},"license":"MIT","homepage":"https://github.com/be-lenka/be-a11y#readme","keywords":["js","web-accesibility","a11y"],"repository":{"url":"git+https://github.com/be-lenka/be-a11y.git","type":"git"},"description":"Web accesibility tools","maintainers":[{"email":"dev+npm@belenka.com","name":"be-lenka"},{"email":"misak@belenka.com","name":"misak1"}],"readme":"# be-a11y !\n\n**be-a11y** is a Node.js-based CLI tool designed for automated evaluation and reporting of accessibility issues in HTML-based projects. It supports both local directory scanning and remote URL analysis to help developers identify common accessibility problems.\n\n![Accessibility Checker](https://github.com/user-attachments/assets/40c82668-7894-4560-a7ed-77f892021bdd)\n\n---\n\n## Features\n\n* ✅ Detects incorrect heading level order (e.g., `h1` → `h3` skipped)\n* 🖼️ Evaluates `<img>` tags for appropriate `alt` attributes\n  * ⬜ Flags empty `alt` attributes\n  * ↔️ Detects excessively long `alt` texts (configurable)\n  * 🌈 Verifies decorative images have empty or proper `alt`\n  * 🔗 Highlights functional images missing descriptive `alt`\n* ♿ Validates `aria-label` and `aria-labelledby` usage\n* 👀 Detects elements that lack accessible names or labels (e.g., `<button>`, `<a>`, `<svg>`)\n* 🎨 Evaluates color contrast between text and background against WCAG 2.1 AA criteria\n* 📂 Analyzes local files in directories with supported extensions: `.html`, `.php`, `.latte`, `.twig`, `.edge`, `.tsx`, `.jsx`\n* 🌐 Supports remote evaluation by analyzing pages via URL\n* 📤 Optional JSON export of evaluation results\n* 🎨 CLI output is grouped, color-coded, and includes file names with line numbers\n* ▶️ Automatically excludes common build directories (e.g., `node_modules`, `dist`)\n* 📝 CI-friendly: returns a non-zero exit code when issues are found\n* 🗃️ Supports rule-based configuration via `a11y.config.json`\n  * Enable or disable specific checks\n  * Fine-tune behavior of sub-rules (e.g., `alt-too-long`)\n* 🔗 Checks that <label> elements are correctly associated with form controls (via for or nesting) (new!)\n\n---\n\n## Usage\n\n### Install dependencies:\n\n```bash\nnpm install\n```\n\n### Run the script:\n\n```bash\nnode index.js /path/to/html/files/\n\n# or\n\nnode index.js https://example.com\n```\n\n### Export results to JSON (optional):\n\n```bash\nnode index.js /path/to/html/files report.json\n\n# or\n\nnode index.js https://example.com report.json\n```\n\n### Example Configuration (`a11y.config.json`):\n\n```json\n{\n  \"rules\": {\n    \"heading-order\": true,\n    \"missing-alt\": true,\n    \"alt-empty\": true,\n    \"alt-too-long\": false,\n    \"alt-decorative-incorrect\": true,\n    \"alt-functional-empty\": true,\n    \"aria-invalid\": true,\n    \"missing-aria\": true,\n    \"aria-role-invalid\": true,\n    \"missing-landmark\": false,\n    \"contrast\": true\n  }\n}\n```\n\n> Configuration allows per-rule toggling. All rules are enabled by default unless explicitly disabled.\n\n---\n\n## Future Tools\n\n* GitHub Action support\n* Rule severity levels (`warning` vs `error`)\n* CI summary report in SARIF format\n* VS Code plugin integration\n\n---\n\n## 🤝 Contributing\n\nWe welcome contributions from the community! Whether it's a bug fix, feature proposal, or documentation update — your input is valuable.\n\nPlease read our [Contribution Guide](./docs/CONTRIBUTING.md) to get started.\n\n---\n\n## TL;DR: 🏩 European Accessibility Act (EAA) Compliance Support\n\nThe European Accessibility Act (EAA), effective from **June 28, 2025**, requires certain digital products and services to comply with accessibility standards across the EU.\n\nWhile this tool does not guarantee full compliance, **be-a11y** supports teams in their evaluation efforts by:\n\n* ⚠️ Detecting common accessibility issues as outlined in standards like WCAG 2.1\n* ✅ Providing actionable findings to assist with remediation workflows\n* 🏰 Promoting awareness and adoption of inclusive development practices\n\n**More on EAA:** [European Commission's official page](https://commission.europa.eu/strategy-and-policy/policies/justice-and-fundamental-rights/disability/union-equality-strategy-rights-persons-disabilities-2021-2030/european-accessibility-act_en)\n\n---\n\n**Tool name:** `be-a11y`\n**Repository:** [https://github.com/be-lenka/be-a11y](https://github.com/be-lenka/be-a11y)\n","readmeFilename":"README.md"}