This release is 13 versions behind 1.1.4 — the latest version of @std/path. Jump to latest
Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Built and signed on GitHub Actions
Works with
•JSR Score94%•This package works with Cloudflare Workers, Deno, Browsers


Downloads140,824/wk
•Published2 years ago (1.0.1)
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 as _common } from "../_common/common.ts"; import { SEPARATOR } from "./constants.ts"; /** Determines the common path from a set of paths for POSIX systems. * * @example Usage * ```ts * import { common } from "@std/path/posix/common"; * import { assertEquals } from "@std/assert"; * * const path = common([ * "./deno/std/path/mod.ts", * "./deno/std/fs/mod.ts", * ]); * assertEquals(path, "./deno/std/"); * ``` * * @param paths The paths to compare. * @returns The common path. */ export function common(paths: string[]): string { return _common(paths, SEPARATOR); }