import { Path } from "https://deno.land/x/path@v3.0.0/src/Path.ts";
this class represents a filesystem path, and allows for easy manipulation of said path
Properties
Checks if the path exists
const path = new Path("/home/test/text.txt");
path.exists;
requires: --allow-read flag
returns the extension or null the dot will not be stripped dotfiles are considered extensionless
Methods
findLastValidNode(ignoreFiles?: boolean): Promise<Path>
finds the first valid node walking a path from the right
findLastValidNodeSync(ignoreFiles?: boolean): Path
finds the first valid node walking a path from the right synchronously
mkDir(parents?: boolean): Promise<boolean>
mkDirSync(parents?: boolean): boolean
create the specified path if parents is true any needed paths will be created
rm(recursive?: boolean): Promise<void>
remove self
rmSync(recursive?: boolean): void
remove self sync
toString(): string
prefix?: string,
suffix?: string,
separator?: string,
render this path object as a string
Static Methods
private
explodePath(separators: string[], pathString: string): string[]explodes a string into an array of strings
deprecated
genTmpPath(rngScalar?: number,
prefix?: string,
suffix?: string,
joinChar?: string,
tmpDir?: string,
Generate a new random folder name with it's path set to the system temporary folder
getTmpPath(): Path
makeTmpDir(unnamed 0?: { rngScalar?: number; prefix?: string; suffix?: string; joinChar?: string; tmpDir?: string; }): Path
Generate a new random folder name with it's path set to the system temporary folder