Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

a11y-puppeteer

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

a11y-puppeteer

fast WCAG evaluation with puppeteer

  • 0.0.11
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

a11y

a11y is a high performance web accessibility issue detector that runs around + 10,000x faster than other headless runners.

You need to have an active instance of puppeteer running with a connection to get started. This library does not open a new browser for you. The script used for detection runs very fast.

You can view the pagemind repo for more info on the usage.

Getting Started:

npm i a11y-puppeteer --save

Requires node ^13

import { a11y } from "a11y-puppeteer"

// navigate to the page prior to active instance
await page.goTo("https://mywebsite.com")
const results = await a11y({ page, browser, ...extraConfigs })

a11y resolves with an array of objects, containing details about the page and accessibility issues:

{
    documentTitle: 'The title of the page',
    pageUrl: 'The URL that a11y was run against',
    issues: [
        {
            code: 'WCAG2AA.Principle1.Guideline1_1.1_1_1.H30.2',
            context: '<a href="https://example.com/"><img src="example.jpg" alt=""/></a>',
            message: 'Img element is the only content of the link, but is missing alt text. The alt text should describe the purpose of the link.',
            selector: 'html > body > p:nth-child(1) > a',
            type: 'error',
            typeCode: 1,
            runner: "a11y",
            recurrence: 0
        }
        // more issues...
    ]
}

Runners

a11y supports multiple test runners which return different results. The built-in test runners are:

  • axe: run tests using [aXe-core][axe].
  • htmlcs (default): run tests using [HTML CodeSniffer][htmlcs]
  • custom: custom runners

LICENSE

check the license file in the root of the project.

Keywords

FAQs

Package last updated on 11 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc