Skip to content
0

katanakit-js / useGetFileExtension

Function: useGetFileExtension() ​

ts
function useGetFileExtension(filePath): Promise<string>;

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

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

Parameters ​

ParameterTypeDescription
filePathstringThe path to inspect.

Returns ​

Promise<string>

The extension ("" when there is none).

Example ​

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

Released under the MIT License.