Options
All
  • Public
  • Public/Protected
  • All
Menu

Class StreamParser

Abstract Parser for Streams

An extension of {@link Parser | Parser} that assumes parsing will be done for a stream. Streams supported are Browser Streams (see the Streams API) or Node Streams (see the Node Streams API).

remarks

Since streams are inherently asynchronous, the parseSync method does not make sense as a function. This class implements the parseSync method and throws an error so the subclass implementations don't have to implement it.

Hierarchy

Index

Methods

Protected createBuilder

  • Create a ReportBuilder from the given options

    Parameters

    • Optional rootDirectory: undefined | string

      base directory that all paths are relativized from

    • Default value mode: ReportMode = ReportMode.Simple

      The type of builder that should be created. Defaults to Simple

    Returns ReportBuilder

    ReportBuilder

Abstract parse

  • parse(_: any, __: object): Promise<Report>
  • Parse (Asynchronously)

    Parse an input with the given options and return a Promise of a Report.

    Parameters

    • _: any
    • __: object
      • Optional encoding?: undefined | string
      • Optional mode?: ReportMode
      • Optional rootDirectory?: undefined | string

    Returns Promise<Report>

    Promise that resolves with a parsed Report

Protected parseContents

  • parseContents(contents: string, rootDirectory?: undefined | string, mode?: ReportMode): Report
  • Parse the string contents and return a Report

    Parameters

    • contents: string

      string containing input that should be parsed

    • Optional rootDirectory: undefined | string

      base directory that all paths are relativized from

    • Optional mode: ReportMode

      The type of builder that should be created

    Returns Report

    Parsed Report

parseSync

  • parseSync(_: any, __?: object): Report

Generated using TypeDoc