UseGetFileExtension
katanakit-js / useGetFileExtension
Function: useGetFileExtension()
Section titled “Function: useGetFileExtension()”function useGetFileExtension(filePath): Promise<string>;Defined in: infrastructure/filesystem/path.service.ts:149
Returns the extension of a path, including the leading dot.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
filePath |
string |
The path to inspect. |
Returns
Section titled “Returns”Promise<string>
The extension ("" when there is none).
Example
Section titled “Example”await useGetFileExtension("/data/books.json"); // ".json"