Hierarchy

  • FileIO

Constructors

Methods

Constructors

Methods

  • function opens a utf-8 encoded file (or creates if it doesn't already exist) and appends the passed in data string to it. if the file contains directories and these directories do not already exist they will be created and then the file will be created and appended to

    Parameters

    • file: string

      the full path and filename to write to

    • data: string = ''

      the contents to append

    Returns void

  • opens the specified file and returns the contents as a UTF-8 string and then closes the file

    Parameters

    • file: string

      the relative or full path to an existing file

    Returns string

    the contents of the specifie file as a string

  • attempts to parse the contents of a file into a simple JSON object

    Type Parameters

    • T

    Parameters

    • file: string

      the relative or full path to an existing file

    • Optional jsonParser: Func<string, T>

    Returns T

    the contents of the specified file parsed into a simple object

  • function creates a new utf-8 encoded file and writes the passed in data string to it. if the file contains directories and these directories do not already exist they will be created and then the file will be created and written to

    Parameters

    • file: string

      the full path and filename to write to

    • data: string = ''

      the contents to write

    Returns void

Generated using TypeDoc