• Platform agnostic method to get the file name or basename of a path treating both / as well as \ as directory separators.

    Parameters

    • pathLike: string

      path like string

    • removeExtension: boolean = false

      remove the file extension if any

    Returns string

    Basename of a path with the file suffix