Documentation Index
Fetch the complete documentation index at: https://docs.simular.ai/llms.txt
Use this file to discover all available pages before exploring further.
Class: Directory
Defined in: index.d.ts:336 Represents a directory handle.Constructors
Constructor
new Directory(Defined in: index.d.ts:344 Creates a handle to a directory at the given path. Ifpath,createMissing):Directory
create_missing is true, the directory (and all missing
ancestors) is created when it does not already exist. If false,
the call fails when the directory does not exist.
Parameters
path
string
createMissing
boolean
Returns
Directory
Methods
copyTo()
copyTo(Defined in: index.d.ts:356 Copies the directory recursively to a new location.dest):Directory
Parameters
dest
string
Returns
Directory
delete()
delete(): void
Defined in: index.d.ts:363
Deletes the directory recursively, invalidating the handle.
Returns
void
isReadonly()
isReadonly(): boolean
Defined in: index.d.ts:384
Returns whether the directory is read-only.
Returns
boolean
listDirs()
listDirs(): Directory[]
Defined in: index.d.ts:375
Returns all subdirectories in this directory (non-recursive).
Throws if any individual directory entry fails to read.
Returns
Directory[]
listFiles()
listFiles(): File[]
Defined in: index.d.ts:369
Returns all files in this directory (non-recursive).
Throws if any individual directory entry fails to read.
Returns
File[]
modified()
modified(): number
Defined in: index.d.ts:382
Returns the last modification time of the directory itself as
milliseconds since the Unix epoch.
Returns
number
moveTo()
moveTo(Defined in: index.d.ts:361 Moves the directory to a new location Falls back to copy + delete for cross-device moves.dest):void
Parameters
dest
string
Returns
void
name()
name(): string
Defined in: index.d.ts:377
Returns the directory name (last component of the path).
Returns
string
path()
path(): string
Defined in: index.d.ts:352
Returns the resolved absolute path.
Returns
string
rename()
rename(Defined in: index.d.ts:354 Renames the directory in place (same parent directory)newName):void
Parameters
newName
string
Returns
void
temp()
Defined in: index.d.ts:350 Creates a directory with a unique name inside the system’s temp directory, returning a handle to it. The directory is not automatically removed; callstatictemp():Directory
delete() when done.
Returns
Directory
