{"id":51024186,"url":"https://github.com/dsathyakumar/a11y-auditor","last_synced_at":"2026-06-21T18:02:11.614Z","repository":{"id":57171654,"uuid":"51131214","full_name":"dsathyakumar/a11y-auditor","owner":"dsathyakumar","description":"This project aims at conducting unit tests / audit for accessibility on projects in the development phase and on CI machines.","archived":false,"fork":false,"pushed_at":"2016-04-29T12:23:45.000Z","size":830,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-26T17:04:12.391Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dsathyakumar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-05T06:55:34.000Z","updated_at":"2017-09-13T22:26:53.000Z","dependencies_parsed_at":"2022-08-24T13:30:49.832Z","dependency_job_id":null,"html_url":"https://github.com/dsathyakumar/a11y-auditor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dsathyakumar/a11y-auditor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsathyakumar%2Fa11y-auditor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsathyakumar%2Fa11y-auditor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsathyakumar%2Fa11y-auditor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsathyakumar%2Fa11y-auditor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dsathyakumar","download_url":"https://codeload.github.com/dsathyakumar/a11y-auditor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsathyakumar%2Fa11y-auditor/sbom","scorecard":{"id":357408,"data":{"date":"2025-08-11","repo":{"name":"github.com/dsathyakumar/a11y-auditor","commit":"3ecb9ebdf3fa16dd1367394087d0a70fe0a585c7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 2/24 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 8 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T09:56:16.040Z","repository_id":57171654,"created_at":"2025-08-18T09:56:16.040Z","updated_at":"2025-08-18T09:56:16.040Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34620358,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-21T02:00:05.568Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-21T18:02:10.777Z","updated_at":"2026-06-21T18:02:11.606Z","avatar_url":"https://github.com/dsathyakumar.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# a11y-auditor\n\n\n[![Build Status](https://img.shields.io/travis/dsathyakumar/a11y-auditor.svg?style=flat-square)](https://travis-ci.org/dsathyakumar/a11y-auditor)\n[![Dependency Status](https://img.shields.io/david/dsathyakumar/a11y-auditor.svg?style=flat-square)](https://david-dm.org/dsathyakumar/a11y-auditor)\n[![devDependency Status](https://img.shields.io/david/dev/dsathyakumar/a11y-auditor.svg?style=flat-square)](https://david-dm.org/dsathyakumar/a11y-auditor#info=devDependencies)\n[![peerDependency Status](https://img.shields.io/david/peer/dsathyakumar/a11y-auditor.svg?style=flat-square)](https://david-dm.org/dsathyakumar/a11y-auditor#info=peerDependencies)\n\n\n[![npm](https://img.shields.io/npm/v/a11y-auditor.svg)](https://david-dm.org/dsathyakumar/a11y-auditor#info=version)\n[![DUB](https://img.shields.io/dub/l/vibe-d.svg)]()\n[![Maintenance](https://img.shields.io/maintenance/yes/2016.svg)]()\n[![Coverage Status](https://coveralls.io/repos/github/dsathyakumar/a11y-auditor/badge.svg?branch=master)](https://coveralls.io/github/dsathyakumar/a11y-auditor?branch=master)\n[![Twitter](https://img.shields.io/twitter/url/https/github.com/dsathyakumar/a11y-auditor.svg?style=social)](https://twitter.com/intent/tweet?text=Wow:\u0026url=%5Bobject%20Object%5D)\n[![CodeClimate](https://codeclimate.com/github/dsathyakumar/a11y-auditor/badges/gpa.svg)](https://codeclimate.com/github/dsathyakumar/a11y-auditor)\n\n\n[![NPM](https://nodei.co/npm/a11y-auditor.png)](https://nodei.co/npm/a11y-auditor/)\n\n\n#### Table of Contents\n- [What is this? What does it do ?](#what-is-this-what-does-it-do-)\n- [Status](#status)\n- [Usage Tip with chai-a11y for BDD style to.be.accessible() assertions](#usage-tip-)\n- [Configuring for Node JS Usage](#for-node-js-usage-)\n- [Configuring for Browser usage (include \u003cscript...\u003e and run without AMD)](#for-browser-usage-include--and-run-without-amd)\n- [Configuring for JAVA projects](#for-java-projects-)\n- [Configuring for phantomJS CLI](#configuring-to-run-on-a-phantomjs-cli-)\n- [Method definition of method exported by the Module](#method-definition-of-method-exported-by-the-module-)\n- [Skipping / Ignoring a few rules for some elements](#to-ignore-a-few-rules-)\n- [How to author new rules ?](#to-author-new-rules-)\n- [File Structure of the project](#file-structure-)\n- [Test Cases](#implementation-tests-)\n- [Understanding of the rules implemented](#rule-understanding)\n- [Build Tasks for the project](#build-tasks)\n- [Dependencies](#dependencies-)\n- [Dev Dependencies](#dev-dependencies-)\n- [Contributors](#ideation--contributors-)\n- [License](#license)\n\n\n#### What is this? What does it do ?\n\n\n\u003e This a11y project is an implementation of accessibility rules as defined in [W3C Accessibility Checklist](http://www.w3.org/TR/WCAG10/full-checklist.html)\n\n\u003e Accessibility testing happens on products after they are deployed onto staging and relies on the QA folks. This project along with [chai-a11y](https://github.com/pranavjha/chai-a11y) helps to include accessibility testing as part of the unit tests phase itself.\n\n\u003e [chai-a11y](https://github.com/pranavjha/chai-a11y) provides a BDD style `to.be.accessible()` interface for asserting a11y audits. This audit, helps in cutting down lead time by eliminating dependency over the QA deployments. Accessibility issues can now be spotted in the development phase itself.\n\n\u003e Recursively conducts accessibility audits on HTML partials / snippets / mocked HTML response (inclusive of child nodes)\n\n\n#### Status\n\n**Status** : Dev (in progress) \u0026 **Pull requests are welcome!**\n\n\n\n#### Usage Tip :\n---------------------------------------------------------\nIts recommended to use a11y-auditor to run accessibility audit for A, AA, AAA compliance on your web pages as part of your Dev testing (unit tests) itself via the [chai-a11y](https://github.com/pranavjha/chai-a11y) plugin.\n\n[chai-a11y](https://github.com/pranavjha/chai-a11y) is a chai plugin available as an [npm](https://www.npmjs.com/package/chai-a11y) module which consumes a11y-auditor, provides a `to.be.accessible()` interface for asserting a11y audits, and helps run tests, conduct audits on a headless phantomJS instance (supporting all flavors of javascript :- AMD, common JS style and also via script tag loading.)\n\n\n\n#### For Node JS usage :\n---------------------------------------------------------\nrequire the module as require('a11y-auditor') and add it to the dependencies. This will return a [function ()]. Use it in your module. But its recommended to use a11y-auditor with the chai-a11y plugin that provides BDD style `to.be.accessible()` interface via chai js and can be integrated with mocha tests and run on development machines and CI.\n\n```\nvar auditRunner = require('a11y-auditor');\n\nvar result = auditRunner.run(htmlSelector, rulesConfig, auditConfig);\n```\n\n\n#### For Browser usage (include \u003cscript...\u003e and run without AMD):\n---------------------------------------------------------\nUse the distribution file at `dist/browser/a11y-auditor.min.js`. This comes bundled with dependencies like `jQuery (v 2.2.0)`, `lodash (4.3.0)`. However, if you just want the source file alone, its available at `dist/browser/a11y-auditor.min.only.js`\n\nImplement it as :\n\n```\nwindow.onload = function(){\n\t\twindow.auditRunner.run(htmlSelector, rulesConfig, auditConfig);\n}\n```\nBut its recommended to use a11y-auditor with the chai-a11y plugin that provides BDD style `to.be.accessible()` interface via chai and can be integrated with mocha tests and run on development machines and CI.\n\n\n\n#### For JAVA projects :\n---------------------------------------------------------\nIt is possible to run a grunt workflow via MAVEN builds using the [Front end maven plugin](https://github.com/eirslett/frontend-maven-plugin) and execute test cases built on mocha and chai. The above setup for a11y-auditor \u0026 chai-a11y ( mentioned above for Node JS ) holds good here as well, as the Front End Maven plugin downloads and installs a node executable. You will have to [integrate your project](https://www.linkedin.com/pulse/node-npm-java-maven-damodaran-sathyakumar) with the Front End Maven Plugin before attempting to use a11y-auditor for JAVA based projects built on JSP / JSF / Struts.\n\n\n#### Configuring to run on a phantomJS CLI :\n---------------------------------------------------------\nThe a11y-auditor has a command line runner to conduct the audit on static HTML files and on any URL's directly. To use the runner, install phantomjs then run the following command from the project root directory.\n\n```\n$ phantomjs phantomRunner/phantomRunner.js \u003cpath-to-StaticFile-or-URL\u003e \u003cpath-To-A11yAuditor-Distribution-File\u003e \u003cpath-to-outPutFile\u003e\n\n```\nThe `phantomRunner.js` can be found at `phantomRunner/phantomRunner.js` in the repo.\n\n#### Method definition of method exported by the Module :\n--------------------------------------------------\n\nThe method takes in 3 parameters:\n\n```\nvar auditRunner = require('a11y-auditor');\n\nvar result = auditRunner.run(htmlSelector, rulesConfig, auditConfig);\n\n```\n\n1. **htmlSelector or DOM object** - A valid HTML selector or a DOM object or a jquery DOM object (containing child nodes is also cool) (eg. 'button')\n2. **rulesConfig** - A config obj containing rules to be ignored for some elements matched by valid HTML selectors as shown below\n3. **auditConfig** - A config obj for the a11y-auditor that governs compliance, global rules execution etc.,\n\n`auditConfig` takes in 3 properties / keys :\n\n- *'executeGlobalRules'*: A Boolean to indicate whether global rules that audit the whole document need to be ignored.\n- *'compliance'* : Takes an array, containing values from : `'A', 'AA', 'AAA'`\n- *'displayOptions'* : Takes one of the values ` 'error', 'warning', 'errAndWarn' `\n\n\n\n#### To ignore a few rules :\n-----------------------\nRules can be ignored by passing the `ruleID` or the `short name` of the rule.\n\n`As an example :`\n\n```\nwindow.auditRunner.run(“img”, {\n\t‘img’ : [‘imageWithoutAltText'],\n\t‘#sampleId1’ : [‘AX_22’, 'AX_33'],\n\t‘title’ : [‘*’] //* will skip all rules for the selector\n},{\n\texecuteGlobalRules : true,\n\tcompliance : ['AA'],\n\tdisplayOptions : 'errAndWarn'\n\t});\n\n```\nIn the above example, for the selector `#sampleId1`, rules `AX_22` and `AX_33` are skipped.\nAnd, `AA` compliance is only tested for.\nFor all objects corresponding to `img` selector, the `imageWithoutAltText` is skipped.\nSince the `displayOptions` is set to `errAndWarn`, all errors and Warnings are shown.\n\n**Note :** If there is no HTML partial object or selector passed, it will perform the audit for the whole document, under the assumption that `a11y-auditor.min.js` is included inside an HTML document.\n\n\n#### To execute only a selected few rules :\n-----------------------\nOnly a select set of few rules can be executed on a given selector or DOM object.\n\n`As an example :`\n\n```\nwindow.auditRunner.runOnly(“img”, {\n\t‘img’ : [‘imageWithoutAltText']\n});\n\n```\n\nIn the above example, for the selector `img`, only the rule `imageWithoutAltText` is executed.\nAny other valid rules which may exist for this selector, is just ignored. This helps to run targeted rules on components or widgets. Also, only the first element matching the selector is used to run this test on.\n\n#### To author new rules :\n---------------------------------------------------------\n1. Create a new numbered rule named file AX_XX.js (eg: AX_01.js) under lib/rulesImpl\n2. Follow the pattern in which the files are authored under lib/rulesImpl/AX_XXX.js\n3. The exported object via module.exports will contain the following:\n\n```\nmodule.exports = {\n\tname: \"shortNameMentioningWhatThisRuleDoes\",\n\tdescription: \"Detailed description of the rule\",\n\truleID: \"AX_XXX\",\n\ttagName: ['comma separated array of tagNames'], // the rule will execute for the tags mentioned here\n\thandler: function(){/* Your implementation here */},\n\tisGlobal: Boolean //to indicate if this rule checks on document level checks,\n\tcompliance : ['AA']\n};\n\n```\n\n`tagName` can take :\n\n1. ['comma separated array of tagNames'] - if its not a Global Rule.\n2. [] - if its a Global Rule as its not tag specific and will execute just once for the document.\n3. ['\\*'] - if its to execute for all tags\n\n`compliance` can take values from : A, AA, AAA\n\n`isGlobal` can take : true / false\n\n\n\n#### File Structure :\n--------------------\n\n| Directory  | Description |\n| :---         | :---       |\n| dist/  | The distribution file to use in browser environments |\n| lib/auditRunner  | The engine that recursively iterates \u0026 performs the audit \u0026 exposes an interface to consume  |\n| lib/constants  | Constants / Enums  |\n| lib/axs  | Utils for certain rules  |\n| lib/enums  | List of enums  |\n| lib/mapper  | Mapper functions that map rules to handler and tagName  |\n| lib/rulesImpl  | Implementation functions that contain the rule implementation  |\n| lib/rulesProcessor  | Code to pick up rules and add it to the auditRulesCreator  |\n| lib/utils  | Code containing utils for enum creation, DOM object checks and dependency injections  |\n| test/  | The test cases written for this project  |\n\n\n\n#### Implementation Tests :\n--------------------\n\nIndividual tests for each of the rules implemented have been placed under tests. The test cases are built with the help of\n[Mocha](http://mochajs.org) and [Chai](http://chaijs.com) for BDD style assertions. The tests are integrated into the workflow via Grunt.\n\n\n\n#### Rule Understanding:\n--------------------\n\nThe a11y-auditor aims to automate rules defined in the [W3C Accessibility Checklist](http://www.w3.org/TR/WCAG10/full-checklist.html), which contains numerous rules.\nIn order to make creation of rules easier, each rule is implemented in a modular fashion in a separate file. To understand what each rule does, look at the a11y.properties.json file.\n\n\n\n#### Build Tasks\n--------------------\n\n##### `clean` task\n\nThis task will clean up the residue directories .test, .coverage, .docs.\n\n\n##### `lint` task\n\nThis task runs [jshint](http://jshint.com/), [jsonlint](https://www.npmjs.com/package/grunt-jsonlint),\n[jscs](http://jscs.info/) on the source files.\n\n\n##### `test` task\n\nRuns the above lint task and [mocha](https://mochajs.org) test cases over a sampled DOM via [jsdom](https://github.com/tmpvar/jsdom)\n\n\n##### `coverage` task\n\nRuns [mocha](https://mochajs.org) test cases and use [istanbul](https://gotwarlost.github.io/istanbul/) to instrument code \u0026 collects the coverage info to build coverage reports \u0026 submit .lcov to [coveralls.io](https://coveralls.io/) for code coverage\n\n\n##### `build` task\n\nGenerates the distribution file built via [Browserify](http://browserify.org) \u0026 also the Documentation and publishes it to the GH pages.\n\n\n##### `document` task\n\nGenerates Code Documentation using [docco-plus](https://www.npmjs.com/package/docco-plus)\n\n\n\n#### Dependencies :\n--------------------\n\njQuery (v 2.2.0), lodash (4.3.0), glob (6.0.4)\n\n\n\n#### Dev Dependencies :\n--------------------\nGrunt, grunt-mocha-test, Chai, grunt-browserify, jsdom, grunt-istanbul, grunt-contrib-watch, grunt-jsonlint, grunt-jscs, grunt-contrib-jshint, docco-plus, proxyquire, sinon-chai, grunt-contrib-copy, grunt-contrib-clean, require-globify\n\n\n\n#### Ideation \u0026 Contributors :\n--------------------\n[@pranavjha](https://github.com/pranavjha/)\n[@gopalj](https://github.com/gopalj)\n\n\n#### License\n-------------\n\u003e The MIT License (MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsathyakumar%2Fa11y-auditor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdsathyakumar%2Fa11y-auditor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsathyakumar%2Fa11y-auditor/lists"}