import * as mod from "https://deno.land/std@0.217.0/path/posix/mod.ts";
Utilities for working with OS-specific file paths.
Codes in the examples uses POSIX path but it automatically use Windows path
on Windows. Use methods under posix
or win32
object instead to handle non
platform specific path like:
import { posix, win32 } from "https://deno.land/std@0.217.0/path/mod.ts";
const p1 = posix.fromFileUrl("file:///home/foo");
const p2 = win32.fromFileUrl("file:///home/foo");
console.log(p1); // "/home/foo"
console.log(p2); // "\\home\\foo"
This module is browser compatible.
Functions
Return the last portion of a | |
Determines the common path from a set of paths, using an optional separator, which defaults to the OS default separator. | |
Return the directory path of a | |
Return the extension of the | |
Generate a path from | |
Converts a file URL to a path string. | |
Convert a glob string to a regular expression. | |
Verifies whether provided path is absolute | |
Test whether the given string is a glob | |
f join | Join all given a sequence of |
Like join(), but doesn't collapse "**/.." when | |
Normalize the | |
Like normalize(), but doesn't collapse "**/.." when | |
Return a | |
Return the relative path from | |
Resolves path segments into a | |
Converts a path string to a file URL. | |
Resolves path to a namespace path |
Interfaces
Options for | |
A parsed path object generated by path.parse() or consumed by path.format(). |