项目作者: JakePartusch

项目描述 :
An automated website accessibility scanner and cli
高级语言: JavaScript
项目地址: git://github.com/JakePartusch/lumberjack.git
创建时间: 2020-02-05T18:34:27Z
项目社区:https://github.com/JakePartusch/lumberjack

开源协议:MIT License

下载



Lumberjack


Chop down accessibility issues with this full-website accessibility scanner


Woman in winter attire standing with an ax next to a tree

About

Lumberjack runs axe accessibility checks on your entire website!

  • Reads your website’s sitemap
  • Spawns multiple browser instances and starts scanning with axe
  • Aggregates results and reports back


    Screenshot of lumberjack in action. Print the individual accessibility issues found in an example

Usage

CLI

NPX (recommended for a single run)

  1. npx @jakepartusch/lumberjack --url https://google.com

Global Install (recommended for multiple runs)

  1. npm install -g @jakepartusch/lumberjack
  2. lumberjack --url https://google.com

Options

  1. --url // Required — The base url to scan. If a sitemap exists, its pages will be scanned as well
  2. --strict // Optional (default: false) — Fail the process if any accessibility issues are found
  3. --baseUrlOnly // Optional (default: false) — Skip the sitemap scan and only run the audit on the base url

JavaScript

  1. npm install @jakepartusch/lumberjack
  1. const lumberjack = require('@jakepartusch/lumberjack');
  2. const myFunction = async () => {
  3. const results = await lumberjack("https://google.com");
  4. console.log(results);
  5. }

Continuous Integration

GitHub Actions Example
(eg. “.github/workflows/accessibility.yml”)

  1. name: Accessibility Audits
  2. on: [push]
  3. jobs:
  4. build:
  5. runs-on: ubuntu-18.04
  6. steps:
  7. - uses: actions/checkout@v1
  8. - name: Install required Linux packages
  9. run: |
  10. sudo apt-get update
  11. sudo apt-get install libgbm-dev
  12. sudo apt-get install xvfb
  13. - name: Use Node.js 12.x
  14. uses: actions/setup-node@v1
  15. with:
  16. node-version: 12.x
  17. - name: Install npm packages
  18. run: |
  19. npm ci
  20. - name: Build
  21. run: |
  22. npm run build
  23. - name: Accessibility Audits
  24. run: |
  25. npm install -g @jakepartusch/lumberjack
  26. xvfb-run --auto-servernum lumberjack --url https://google.com