@ta11y/reporter
Output reporters for ta11y audit results.
Last updated 7 months ago by fisch0920 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @ta11y/reporter 
SYNC missed versions from official npm registry.

ta11y Logo

@ta11y/reporter

Output reporters for ta11y audit results.

NPM Build Status JavaScript Style Guide

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.
    • opts.file string? Filename to write.
    • opts.format string? File format to use (by default this is inferred from the filename).
    • opts.encoding string? File encoding to use (by default this is inferred from the file format).

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.
    • opts.file string? Filename to write.
    • opts.format string? File format to use (by default this is inferred from the filename).
    • opts.encoding string? File encoding to use (by default this is inferred from the file format).
  • auditResults object JSON audit results to format.

License

MIT © Saasify

Current Tags

  • 1.3.1                                ...           latest (7 months ago)

5 Versions

  • 1.3.1                                ...           7 months ago
  • 1.2.1                                ...           7 months ago
  • 1.2.0                                ...           7 months ago
  • 1.1.4                                ...           7 months ago
  • 1.1.3                                ...           7 months ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (3)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |