close
Skip to main content
This release is versions behind 1.1.5 — the latest version of @std/path.
Works with
This package works with Cloudflare Workers, Deno, Browsers
This package works with Cloudflare Workers
This package works with Deno
This package works with Browsers
JSR Score100%
Downloads83,449/wk
Published3 years ago (0.210.0)

Utilities for working with file system paths

function common
common(
paths: string[],
sep?: SEP
): string

Determines the common path from a set of paths, using an optional separator, which defaults to the OS default separator.

      import { common } from "@std/path";
      const p = common([
        "./deno/std/path/mod.ts",
        "./deno/std/fs/mod.ts",
      ]);
      console.log(p); // "./deno/std/"

Parameters

optional
sep: SEP

Return Type

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@std/path

Import symbol

import { common } from "@std/path/windows";
or

Import directly with a jsr specifier

import { common } from "jsr:@std/path/windows";