default.PlatformPath.basename - Node documentation
method default.PlatformPath.basename

Usage

import type default from "node:path";

Return the last portion of a path. Similar to the Unix basename command. Often used to extract the file name from a fully qualified path.

Parameters

path: string

the path to evaluate.

optional
suffix: string

optionally, an extension to remove from the result.

Return Type

string