@ta11y/reporter

    1.3.1 • Public • Published

    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

    Install

    npm i @ta11y/reporter

    DownloadsWeekly Downloads

    15

    Version

    1.3.1

    License

    MIT

    Unpacked Size

    20.5 kB

    Total Files

    10

    Last publish

    Collaborators

    • avatar
    • avatar