@ta11y/reporter
v1.3.1
Published
Output reporters for ta11y audit results.
Downloads
14
Readme
@ta11y/reporter
Output reporters for ta11y audit results.
Install
npm install --save @ta11y/reporter
Usage
The easiest way to use this package is to use the CLI.
const { audit } = require('@ta11y/core')
const { formatAuditResults } = require('@ta11y/reporter')
audit('https://en.wikipedia.org')
.then((auditResults) => {
// overview of results (number of urls visited, success, error)
console.log(auditResults.summary)
// save the results to an excel spreadsheet
return formatAuditResults(auditResults, 'out.xls')
})
Formats
We support all output formats supported by SheetJS.
| file type | file ext | container | sheets | Description |
| :-------- | -------: | :-------: | :----- | :------------------------------ |
| xlsx
| .xlsx
| ZIP | multi | Excel 2007+ XML Format |
| xlsm
| .xlsm
| ZIP | multi | Excel 2007+ Macro XML Format |
| xlsb
| .xlsb
| ZIP | multi | Excel 2007+ Binary Format |
| biff8
| .xls
| CFB | multi | Excel 97-2004 Workbook Format |
| biff5
| .xls
| CFB | multi | Excel 5.0/95 Workbook Format |
| biff2
| .xls
| none | single | Excel 2.0 Worksheet Format |
| xlml
| .xls
| none | multi | Excel 2003-2004 (SpreadsheetML) |
| ods
| .ods
| ZIP | multi | OpenDocument Spreadsheet |
| fods
| .fods
| none | multi | Flat OpenDocument Spreadsheet |
| csv
| .csv
| none | single | Comma Separated Values |
| txt
| .txt
| none | single | UTF-16 Unicode Text (TXT) |
| sylk
| .sylk
| none | single | Symbolic Link (SYLK) |
| html
| .html
| none | single | HTML Document |
| dif
| .dif
| none | single | Data Interchange Format (DIF) |
| dbf
| .dbf
| none | single | dBASE II + VFP Extensions (DBF) |
| rtf
| .rtf
| none | single | Rich Text Format (RTF) |
| prn
| .prn
| none | single | Lotus Formatted Text |
| eth
| .eth
| none | single | Ethercalc Record Format (ETH) |
API
formatAuditResults
Formats and outputs the given audit results from @ta11y/core
, optionally writing
them to a file
.
If no options / filename is passed, the input will be returned untransformed.
Type: function (auditResults, opts): Promise
auditResults
object JSON audit results to format.opts
(object | string)? Filename to write or config options.
formatExtractResults
Formats and outputs the given extraction results from @ta11y/extract
, optionally writing
them to a file
.
If no options / filename is passed, the input will be returned untransformed.
Type: function (extractResults, opts, auditResults): Promise
extractResults
opts
(object | string)? Filename to write or config options.auditResults
object JSON audit results to format.
License
MIT © Saasify