Options
All
  • Public
  • Public/Protected
  • All
Menu

goetia - v0.1.0

Index

Functions

  • compareHash(data: unknown, hash: string): boolean
  • exists(loc: PathLike): Promise<boolean>
  • STANDARD FS

    Parameters

    • loc: PathLike

    Returns Promise<boolean>

  • exportJSON(loc: string, data: unknown, readable?: boolean): Promise<void>
  • Exports a JSON File

    Parameters

    • loc: string

      Path to JSON file.

    • data: unknown

      JSON object.

    • readable: boolean = false

      Whether or not to format the file for human readability.

    Returns Promise<void>

  • exportTXT(loc: string, data: string): void
  • Parameters

    • loc: string
    • data: string

    Returns void

  • exportXLSX(loc: string, data: any): Promise<void>
  • Exports an XLSX File

    Parameters

    • loc: string

      Path to XLSX file

    • data: any

      Data to write to XLSX file

    Returns Promise<void>

  • exportXML(loc: string, data: Element | ElementCompact): Promise<void>
  • Exports an XML File

    Parameters

    • loc: string

      Path to XML file

    • data: Element | ElementCompact

      JSON object

    Returns Promise<void>

  • generateChecksum(data: unknown, algorithm?: string): string
  • Parameters

    • data: unknown
    • algorithm: string = 'md5'

    Returns string

  • getExtension(filename: string): undefined | string
  • importCSV(loc: string): Promise<string[][]>
  • Imports a CSV File

    Parameters

    • loc: string

      Path to CSV file

    Returns Promise<string[][]>

    CSV data as an array of arrays

  • importJSON<T>(loc: PathLike): Promise<T>
  • Imports a JSON File

    Type parameters

    • T

    Parameters

    • loc: PathLike

      Path to JSON file

    Returns Promise<T>

    JSON object

  • importTXT(loc: string): Promise<string>
  • Imports a TXT File

    Parameters

    • loc: string

      Path to TXT file

    Returns Promise<string>

    TXT Data

  • importXLSX<T>(loc: string, json?: boolean): Promise<WorkSheet | XLSXJSON<T>>
  • Imports an XLSX File

    Type parameters

    • T

    Parameters

    • loc: string

      Path to XLSX file

    • json: boolean = true

      Whether to return JSON object

    Returns Promise<WorkSheet | XLSXJSON<T>>

    A XLSX Workbook or a JSON object { [key: sheet]: data }.

  • importXML(loc: string, options?: XML2JSON): Promise<Element>
  • Imports an XML File

    Parameters

    • loc: string

      Path to XML file

    • options: XML2JSON = defaultOptsXML

      Options for xml2json

    Returns Promise<Element>

    JSON object

  • makeDir(loc: PathLike, dirName?: string): Promise<PathLike>
  • Makes a new directory and returns its path.

    Parameters

    • loc: PathLike

      The location to make the directory.

    • Optional dirName: string

      Optional name of the directory to create. If not defined the location will be used.

    Returns Promise<PathLike>

  • removeDir(loc: PathLike, dirName?: string): Promise<string>
  • Removes a directory and returns the resulting location.

    Parameters

    • loc: PathLike

      The location of the directory to remove.

    • Optional dirName: string

      Optional name of the directory to remove. If not defined the location will be used.

    Returns Promise<string>

Generated using TypeDoc