This release is 24 versions behind 1.1.4 — the latest version of @std/path. Jump to latest
Utilities for working with file system paths
This package works with Cloudflare Workers, Deno, Browsers


JSR Score
94%
Published
2 years ago (0.219.0)
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // This module is browser compatible. import { isWindows } from "./_os.ts"; import { extname as posixExtname } from "./posix/extname.ts"; import { extname as windowsExtname } from "./windows/extname.ts"; /** * Return the extension of the `path` with leading period. * @param path with extension * @returns extension (ex. for `file.ts` returns `.ts`) */ export function extname(path: string): string { return isWindows ? windowsExtname(path) : posixExtname(path); }