Options
All
  • Public
  • Public/Protected
  • All
Menu

Class IO

Static class responsible for handling all IO requests.

Hierarchy

  • IO

Index

Methods

Static deleteFile

  • deleteFile(filePath: string): boolean
  • Deletes a file from the disk.

    Parameters

    • filePath: string

      Path to file.

    Returns boolean

    Returns true if the file was successfully deleted. Otherwise, returns false.

Static exists

  • exists(filePath: string): boolean
  • Checks if a file exists.

    Parameters

    • filePath: string

      Path to file.

    Returns boolean

    Returns true if the provided file exists. Otherwise, returns false.

Static readFile

  • readFile(filePath: string): string
  • Reads a JSON file.

    Parameters

    • filePath: string

      Path to file.

    Returns string

    Contents of file.

Static writeFile

  • writeFile<T>(filePath: string, json: T): boolean
  • Writes data as JSON to a file.

    Type parameters

    • T: object

    Parameters

    • filePath: string

      Path to file.

    • json: T

      JSON data to write.

    Returns boolean

    Returns true if data was written successfully. Otherwise, returns false.

Generated using TypeDoc