ParsedPath

import { ParsedPath } from "jsr:@ende/path/types";

interface

interface ParsedPath

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

Example

import { parse } from "@ende/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"

Properties

root

root: string

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

dir

dir: string

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

base

base: string

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

ext

ext: string

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

name

name: string

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

Source