Skip to main content
default.PlatformPath.extname - node__path.d.ts - Node documentation
method default.PlatformPath.extname

Usage in Deno

```typescript import type mod from "node:node__path.d.ts"; ```
PlatformPath.extname(path: string): string
Return the extension of the path, from the last '.' to end of string in the last portion of the path. If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string.

Parameters

path: string
the path to evaluate.

Return Type

string

Throws

TypeError
if `path` is not a string.