Get WAI-ARIA compliance reports in your Node.js console

Jun 9, 2015 12:55 GMT  ·  By

Google and the development community in general have been putting a premium on Web Accessibility, as defined by W3C's WAI-ARIA recommendation.

With the World Health Organization estimating the number of people with visual impairments at around 285 million people, ARIA support for your Web page is just like barring entire countries like Brazil, Indonesia or the US from accessing your site.

For such reasons, even if not a primary focus for any of your future Web development projects unless explicitly mentioned in the contract, you should try and use WAI-ARIA friendly code whenever possible or if time permits.

Enter a11y, a tool for your Node.js CLI

Since reading countless of pages from the WAI-ARIA website is out of the question for developers busy at their jobs, automated tools play a significant role in helping get Web Accessibility integrated into anyone's day-to-day routine.

For developers working on Google's Chrome browser, there's the Accessibility Developer Tools extension, but let’s not forget that programmers often prefer other browsers and development environments as well.

Here is where a11y can lend a helping hand, a tool that works from the Node.js command-line, but was also ported by its dedicated fanbase to a Web-accessible service and as a Grunt task.

Getting down with the a11y basics is a piece of cake

Installing a11y is done just like with any other Node.js global utility, by running this command in the Node console:

code
npm install -g a11y
If you want to use it, just run something like:
code
a11y URL

###Example
a11y softpedia.com
This will make Node.js open a PhantomJS (headless browser) instance, load the respective URL, and run a series of ARIA tests.

The results are then plastered all over the console, easy to notice via red crosses and green check-marks that signal Web Accessibility problems and the items for which ARIA compliance has been reached.

Other a11y features allow developers to control the viewport size and see how Web Accessibility is complied with at various resolutions, and also the ability to send test results to a text file for storage on disk.

code
ally --viewport-size=1280x1024
code
a11y URL > log_name.extension

It's not full-proof, but it covers most Accessibility issues

a11y does not identify absolutely all problems within a page's code, but merely provides a baseline on which basic WAI-ARIA recommendations can be supported without having to alter your daily coding routine.

Besides a11y, there are other ways to improve your knowledge of Web Accessibility standards, one of them being Google's Introduction to Web Accessibility course.