function basename

export function basename(path: string, ext?: string): string;

Alternative to Node's path.basename, removing query string after the extension if it exists.

Returns: Basename of the path

Parameters

path: string
Path to get the basename of
optional
ext?: string
File extension to remove