import { Path } from "https://deno.land/x/yxz@0.17.0/path/path.ts";
A class to represent filesystem path.
Properties
readonly
parents: Array<Path>Methods
chmod(mode: number)
chmodSync(mode: number)
chown(uid: number | null, gid: number | null)
chownSync(uid: number | null, gid: number | null)
copyFileSync(toPath: Path | string | URL)
create()
emptyDir()
ensureSymlink(dest: Path | string)
ensureSymlinkSync(dest: Path | string)
exists()
Return a new path with expanded ~ and ~user constructs.
If a home directory can’t be resolved, an error is raised.
isDir(): Promise<boolean>
isFile(): Promise<boolean>
isSymlink(): Promise<boolean>
joinpath(...other: string[])
lstat()
mkdir(options?: Deno.MkdirOptions)
mkdirSync(options?: Deno.MkdirOptions)
open(options?: Deno.OpenOptions)
openSync(options?: Deno.OpenOptions)
parse()
readDir()
readFile(options?: Deno.ReadFileOptions)
readJsonFile<T = JsonValue>(options?: Deno.ReadFileOptions)
readLink()
readTextFile(options?: Deno.ReadFileOptions)
realPath()
remove(options?: Deno.RemoveOptions)
removeSync(options?: Deno.RemoveOptions)
renameSync(newpath: Path | string | URL): Path
resolve()
stat()
statSync()
symlink(newpath: Path | string | URL, options?: Deno.SymlinkOptions)
symlinkSync(newpath: Path | string | URL, options?: Deno.SymlinkOptions)
toJSON()
toString()
truncate(len?: number)
truncateSync(len?: number)
walk(options?: WalkOptions)
walkSync(options?: WalkOptions)
watch(options?: { recursive: boolean; })
writeFile(data: Uint8Array, options?: Deno.WriteFileOptions)
writeFileSync(data: Uint8Array, options?: Deno.WriteFileOptions)
writeJsonFile(value: JsonValue, options?: Deno.WriteFileOptions & { replacer?: (number | string)[] | null; space?: string | number; })
writeTextFile(data: string, options?: Deno.WriteFileOptions)
writeTextFileSync(data: string, options?: Deno.WriteFileOptions)
[Symbol.toPrimitive](hint: string)
Static Methods
cache(...pathSegments: string[])
config(...pathSegments: string[])
cwd(...pathSegments: string[])
Returns path representing the current directory.
Searches for an executable named file in the directories named by the PATH environment variable.
from(...pathSegments: string[])
fromFileUrl(url: string | URL)
fromImportMeta(importMeta: ImportMeta, url?)
Returns path relative to import.meta
.
Note: As hosted script don't reoslve to file system path, library should avoid this method.
fromPathObject(pathObject: FormatInputPathObject)
home(...pathSegments: string[])
Returns path representing the user’s home directory.
If the home directory can’t be resolved, throw error.
makeTempDir(options?: Deno.MakeTempOptions)
makeTempDirSync(options?: Deno.MakeTempOptions)
makeTempFile(options?: Deno.MakeTempOptions)
makeTempFileSync(options?: Deno.MakeTempOptions)
Converts the PATH environment variable into an array of Path instances.