• Set the hidden state of a file or directory

    Parameters

    • pathname: string

      Path to file or directory

    • hidden: boolean

      Whether the item should be hidden (true) or visible (false)

    • Optionalmethod: HideMethod

      Method to use for hiding the file or directory. The default is "auto", which is "dotPrefix" on Linux and macOS, and "systemFlag" on Windows. "all" will attempt to use all relevant methods for the current operating system.

    Returns Promise<SetHiddenResult>

    Promise resolving the final name of the file or directory (as it will change on POSIX systems), and the action(s) taken.

    If the file doesn't exist, permissions are insufficient, or the requested method is unsupported