• Get the directory name of a path, similar to the Unix dirname command. When an empty path is given, returns the root path.

    Parameters

    • path: string

      The file path.

    Returns string