Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/pup/deps.ts>path.parse

Universal process manager built in Deno
Go to Latest
function path.parse
import { path } from "https://deno.land/x/pup@1.0.0-rc.14/deps.ts";
const { parse } = path;

Return a ParsedPath object of the path. Use format to reverse the result.

Examples

Example 1

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

const parsedPathObj = parse("/path/to/dir/script.ts");
parsedPathObj.root; // "/"
parsedPathObj.dir; // "/path/to/dir"
parsedPathObj.base; // "script.ts"
parsedPathObj.ext; // ".ts"
parsedPathObj.name; // "script"

Parameters

path: string

to process