pivotal-cf/a11y

Name: a11y

Owner: Pivotal Cloud Foundry

Description: Accessibility audit tooling for the web (alpha)

Created: 2015-07-21 16:48:00.0

Updated: 2015-07-21 16:48:00.0

Pushed: 2015-09-16 16:45:56.0

Homepage: http://addyosmani.github.io/a11y/

Size: 43115

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

NPM version Build Status Dependency Status

Easy accessibility audits powered by the Chrome Accessibility Tools.

Install
m install --global a11y

PhantomJS, which is used for generating the screenshots, is installed automagically, but in some rare cases it might fail to and you'll get an Error: spawn EACCES error. Download PhantomJS manually and reinstall a11y if that happens.

CLI usage

Run an audit against a URL:

1y todomvc.com

or multiple URLs:

1y todomvc.com google.com
Example

Also works fine against localhost:

1y localhost:9000

and local files:

1y index.html

even with glob patterns:

1y **/*.html
Options
Query help:
1y --help
Customise viewport size

Type: String Default: 1024x768

1y --viewport-size=800x600
Set a custom delay before capturing the page

Type: Number (seconds) Default: 1

1y --delay=5

Useful when the site does things after load that you want to capture.

Verbose mode:
1y <url> --verbose
Write audit to file:
1y <url> > audit.txt
Module usage

Audit a remote URL and generate an accessibility report:

a11y = require('a11y');

('twitter.com', function (err, reports) {
var audit = reports.audit; // a11y Formatted report
var report = reports.report; // DevTools Accessibility Audit formatted report

Work with the output of reports.audit:

a11y = require('a11y');

('twitter.com', function (err, reports) {
reports.audit.forEach(function (el) {
    // result will be PASS, FAIL or NA
    if (el.result === 'FAIL') {
        // el.heading
        // el.severity
        // el.elements
    }
});

Passing options:

a11y = require('a11y');
options = {
ewportSize: '800x600'


('twitter.com', options, function (err, reports) {
// ...

Currently, the only suported option is:

Interpreting results

To interpret how to fix individual issues in an audit, see the Audit Rules section of the Accessibility Developer Tools project.

Per the Accessibility Developer Tools, the results in an audit may be one of three types:

Build-system integration

If you use Grunt, grunt-a11y is a task by Joćo Figueiredo that uses a11y under the hood.

Status

At this time, this module should be relatively reliable when auditing for accessibility issues in static sites.

We are actively working on exploring support for complex web-applications, including those using JavaScript libraries such as Polymer, Angular and React/Flux. We hope to bring this work to the main master branch once it is considered stable.

License

Apache-2.0


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.