Skip to main content
Module

x/lume/deps/path.ts>posix.extname

🔥 Static site generator for Deno 🦕
Very Popular
Go to Latest
function posix.extname
import { posix } from "https://deno.land/x/lume@v2.1.4/deps/path.ts";
const { extname } = posix;

Return the extension of the path with leading period.

Examples

Example 1

import { extname } from "https://deno.land/std@0.224.0/path/extname.ts";

console.log(extname("/home/user/Documents/")); // ""
console.log(extname("/home/user/Documents/image.png")); // ".png"

Parameters

path: string

with extension

Returns

string

extension (ex. for file.ts returns .ts)