Skip to content

UseGetFileExtension

katanakit-js / useGetFileExtension

function useGetFileExtension(filePath): Promise<string>;

Defined in: infrastructure/filesystem/path.service.ts:149

Returns the extension of a path, including the leading dot.

Parameter Type Description
filePath string The path to inspect.

Promise<string>

The extension ("" when there is none).

await useGetFileExtension("/data/books.json"); // ".json"