Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback


The Deno Standard Library
Go to Latest
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.// This module is browser compatible.
import { isWindows } from "./_os.ts";import { dirname as posixDirname } from "./posix/dirname.ts";import { dirname as windowsDirname } from "./windows/dirname.ts";
/** * Return the directory path of a `path`. * @param path - path to extract the directory from. */export function dirname(path: string): string { return isWindows ? windowsDirname(path) : posixDirname(path);}