# puppeteer-accessibility-audit

> Lightweight library for performing accessibility audits of URL's or files using [Chrome Accessibility Tools](https://www.npmjs.com/package/accessibility-developer-tools)

Latest version **1.1.3** (published 2017-09-27) · SEE LICENSE IN LICENSE license · 0 weekly downloads

## Install

```sh
npm install puppeteer-accessibility-audit
pnpm add puppeteer-accessibility-audit
yarn add puppeteer-accessibility-audit
bun add puppeteer-accessibility-audit
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.3 |
| Published | 2017-09-27 |
| First published | 2017-09-26 |
| Weekly downloads | 0 |
| License | SEE LICENSE IN LICENSE |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Paul Hawxby |
| Maintainers | phawxby |

## Links

- npm: https://www.npmjs.com/package/puppeteer-accessibility-audit
- npm.io page: https://npm.io/package/puppeteer-accessibility-audit

## Dependencies (3)

- [puppeteer](https://npm.io/package/puppeteer.md) ^0.11.0
- [protocolify](https://npm.io/package/protocolify.md) ^2.0.0
- [accessibility-developer-tools](https://npm.io/package/accessibility-developer-tools.md) ^2.12.0

## Recent versions

- 1.1.3 (latest) — 2017-09-27
- 1.1.2 — 2017-09-27
- 1.1.1 — 2017-09-27
- 1.1.0 — 2017-09-26
- 1.0.4 — 2017-09-26
- 1.0.3 — 2017-09-26
- 1.0.0 — 2017-09-26

## README

# Puppeteer Accessibility Audit

Lightweight library for performing accessibility audits of URL's or files using [Chrome Accessibility Tools](https://www.npmjs.com/package/accessibility-developer-tools)

Utilises [GoogleChrome/puppeteer](https://github.com/GoogleChrome/puppeteer) and [GoogleChrome/accessibility-developer-tools](https://github.com/GoogleChrome/accessibility-developer-tools).

## Installation

```shell
npm install --save-dev puppeteer-accessibility-audit
```
or
```shell
yarn add --dev puppeteer-accessibility-audit
```

## Usage

```javascript
const paa = require('puppeteer-accessibility-audit');

// Launch puppeteer to begin auditing
await paa.launch();

// Audit the supplied file and return the result
let paaResult = await paa.audit("test-file.html", opts);

// This is important to terminate any running chromium processes
await paa.destroy();
```

`audit()` will return an object with two properties

* `audit`: An array containing every failure of that file
* `report`: Contains the result of [`axs.Audit.createReport`](https://github.com/GoogleChrome/accessibility-developer-tools#creating-a-useful-error-message)

## Config

Config can be supplied to `paa.launch()`

* `puppeteerConfig` is passed to: [puppeteer.launch](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions)
* `viewport` is passed to: [page.setViewport](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagesetviewportviewport)
* `auditScopeSelector` is used to target the audit and is passed to a `document.querySelector`. 

For example

```javascript
await paa.launch({
  puppeteerConfig: {
    timeout: 5000,
    headless: false
  },
  viewport: {
    width: 1920,
    height: 1080
  },
  auditScopeSelector: "#content"
});
```

## Credits

Lots of copy and pasting of [a11y](https://github.com/addyosmani/a11y) by [Addy Osmani](https://github.com/addyosmani)

---
_Source: https://npm.io/package/puppeteer-accessibility-audit · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
