Interface ParsedPath

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

import { parse } from "@std/path";

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"
interface ParsedPath {
    base: string;
    dir: string;
    ext: string;
    name: string;
    root: string;
}

Properties

Properties

base: string

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

dir: string

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

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:'