Skip to main content

Path

To manipulate file and directories use the path related operations available in the Path module.

join()

Joins multiple paths.

join(paths: string[]): string;

extname()

Returns the extension of the path (with the point). If there's no extension in the path, it returns an empty string.

extname(filePath: string): string;

basename()

Returns the last portion of a path, similar to the Unix basename command.

basename(filePath: string): string;

dirname()

Returns the directory name of a path, similar to the Unix dirname command.

dirname(filePath: string): string;