npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

axegrinder

v2.0.1

Published

Crawl websites for accessibility issues from the command line.

Downloads

4

Readme

Axegrinder

Axegrinder is a command-line tool for developers that crawls websites and runs aXe accessibility tests on every page it finds. Tests are run in a headless chromium instance—the real deal.

This tool is only meant to find and flag problematic pages. For detailed (and interactive) results, try one of the aXe browser plugins.

👉 Chrome 👉 Firefox

Installation

Axegrinder is a node.js package so you'll need node and npm installed. You can install the package globally and run it from the command line.

npm i axegrinder -g

Reference

Further explanations of all the options can be found below.

Usage: axegrinder [options] <url>

Crawls a website and reports accessibility issues for each page.


Options:

  -c, --csv <filepath>    path to CSV output file
  -i, --include [string]  include only URLs containing this string
  -e, --exclude [string]  exclude any URLs containing this string
  -t, --tags <string>     comma-separated list of rule tags (wcag2a,wcag2aa,section508,best-practice)
  -x, --xpaths            show xpaths in console results
  -h, --help              output usage information

Basic Usage

Point axegrinder at a URL and it will do its best to find and test as many pages as possible.

axegrinder https://nodejs.org

First, it will build a map of the site by crawling as much as it can. Once that's done, it will run through every page and execute a battery of accessibility tests in a headless browser.

Results logged to the terminal will either be a pass (in green), or contain a list of violations (in red). If aXe was unable to complete certain tests, those will be marked as "incomplete" (highlighted in yellow).

Options

-c, --csv

Of course, it's not super useful to get results in the command line. For a more permanent results set, use the --csv option.

axegrinder crawl https://nodejs.org --csv=path/to/output.csv

Axegrinder will log each violation or incomplete test, along with the URL of the page that caused it. If you abort the crawl early, your results up to that point will still be saved to the CSV file.

-t, --tags

Since axegrinder is a wrapper around aXe, you can use any of the aXe "tags" to specify which tests to run.

axegrinder crawl http://nodejs.org --tags=wcag2a,wcag2aa

Note that you can set multiple tags at once, as a comma-separated list. By default, axegrinder sets this option to wcag2aa (AA compliance).

The available options are listed below. The names are pretty self-explanatory, but you can check the aXe docs for specifics.

  • wcag2a
  • wcag2aa
  • section508
  • best-practice

-i, --include

Odds are pretty good that you don't want to test your entire site all at once. You can use the --include arg to only include pages that have a specific string in the URL.

# Only scan pages with "/en/about" in the URL
axegrinder crawl https://nodejs.org --include=/en/about

This option can be used multiple times to specify several strings.

-e, --exclude

This works the opposite way that the "include" option works. Use --exclude to ignore pages that have a given string in their URL.

# Skip any pages with "/blog" in the URL
axegrinder crawl https://nodejs.org --exclude=/blog

This option can be used multiple times to specify several strings.

-x, --xpaths

If you'd like to include the xpaths for nodes that triggered violations, you can do so with the --xpaths flag. Adding this flag causes lists of xpaths to show up in your results.

axegrinder crawl https://nodejs.org --xpaths

This can be useful for a quick idea of how many specific issues your pages have, but I very much advise against using it for any serious debugging. The official aXe browser extensions are specifically built for that purpose and do an infinitely better job.

-h, --help

Print out the handy-dandy help dialogue, as seen in the Reference section.

axegrinder --help