Hierarchy

  • FileSystem

Methods

  • Determines if the file exists.

    Returns

    • true if the file system item at the path exists and it is a file.
    • false if there is no the file system item at the path.

    Throws

    • Error if the file system item at the path exists but is is of different type e.g. a directory.
    • Error including the path and the method name if some other file system error happended.

    Parameters

    • filePath: string

    Returns Promise<boolean>

  • Reads file text using UTF-8 encoding if the file exists.

    Returns

    null if the file does not exist.

    Parameters

    • filePath: string

    Returns Promise<null | string>

  • If the file already exists, then it is overwritten. Also creates directories on the file path if they do not exist.

    Parameters

    • filePath: string
    • contents: string

    Returns Promise<void>

Generated using TypeDoc