Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback


The Deno Standard Library
Go to Latest
interface ParsedPath
import { type ParsedPath } from "";

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


Example 1

import { parse } from "";

const parsedPathObj = parse("c:\\path\\dir\\index.html");
parsedPathObj.root; // "c:\\"
parsedPathObj.dir; // "c:\\path\\dir"
parsedPathObj.base; // "index.html"
parsedPathObj.ext; // ".html"; // "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'