This release is 35 versions behind 1.1.4 — the latest version of @std/path. Jump to latest
Works with
•JSR Score94%•This package works with Cloudflare Workers, Deno, Browsers


Downloads107,185/wk
•Published2 years ago (0.211.0)
Utilities for working with file system paths
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // This module is browser compatible. import { _common } from "./_common/common.ts"; import { SEP } from "./separator.ts"; /** Determines the common path from a set of paths, using an optional separator, * which defaults to the OS default separator. * * ```ts * import { common } from "@std/path"; * const p = common([ * "./deno/std/path/mod.ts", * "./deno/std/fs/mod.ts", * ]); * console.log(p); // "./deno/std/" * ``` */ export function common(paths: string[], sep: typeof SEP = SEP): string { return _common(paths, sep); }