Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/proc/site/scripts/deps/path.ts>ParsedPath

A better way to work with processes in Deno.
Latest
interface ParsedPath
Re-export
import { type ParsedPath } from "https://deno.land/x/proc@0.22.1/site/scripts/deps/path.ts";

A parsed path object generated by path.parse() or consumed by path.format().

Examples

Example 1

import { parse } from "https://deno.land/std@0.224.0/path/mod.ts";

const parsedPathObj = parse("c:\\path\\dir\\index.html");
parsedPathObj.root; // "c:\\"
parsedPathObj.dir; // "c:\\path\\dir"
parsedPathObj.base; // "index.html"
parsedPathObj.ext; // ".html"
parsedPathObj.name; // "index"

Properties

root: string

The root of the path such as '/' or 'c:'

dir: string

The full directory path of the parent such as '/home/user/dir' or 'c:\path\dir'

base: string

The file name including extension (if any) such as 'index.html'

ext: string

The file extension (if any) such as '.html'

name: string

The file name without extension (if any) such as 'index'

root: string

The root of the path such as '/' or 'c:'

dir: string

The full directory path of the parent such as '/home/user/dir' or 'c:\path\dir'

base: string

The file name including extension (if any) such as 'index.html'

ext: string

The file extension (if any) such as '.html'

name: string

The file name without extension (if any) such as 'index'