FileType
Sandbox filesystem object type.Enumeration Members
Classes
Filesystem
Module for interacting with the sandbox filesystem.Constructors
Parameters
Returns
Filesystem
Methods
exists()
Parameters
Returns
Promise<boolean>
true if the file or directory exists, false otherwise
getInfo()
Parameters
Returns
Promise<EntryInfo>
information about the file or directory like name, type, and path.
list()
Parameters
Returns
Promise<EntryInfo[]>
list of entries in the sandbox filesystem directory.
makeDir()
Parameters
Returns
Promise<boolean>
true if the directory was created, false if it already exists.
read()
read(path, opts)
string.
You can pass text, bytes, blob, or stream to opts.format to change the return type.
Parameters
Returns
Promise<string>
file content as string
read(path, opts)
Uint8Array.
You can pass text, bytes, blob, or stream to opts.format to change the return type.
Parameters
Returns
Promise<Uint8Array>
file content as Uint8Array
read(path, opts)
Blob.
You can pass text, bytes, blob, or stream to opts.format to change the return type.
Parameters
Returns
Promise<Blob>
file content as Blob
read(path, opts)
ReadableStream.
You can pass text, bytes, blob, or stream to opts.format to change the return type.
Parameters
Returns
Promise<ReadableStream<Uint8Array>>
file content as ReadableStream
remove()
Parameters
Returns
Promise<void>
rename()
Parameters
Returns
Promise<EntryInfo>
information about renamed file or directory.
watchDir()
Parameters
Returns
Promise<WatchHandle>
WatchHandle object for stopping watching directory.
write()
write(path, data, opts)
Parameters
Returns
Promise<WriteInfo>
information about the written file
write(files, opts)
Parameters
Returns
Promise<WriteInfo[]>
Interfaces
EntryInfo
Sandbox filesystem object information.Properties
group
mode
modifiedTime?
name
owner
path
permissions
size
symlinkTarget?
type?
FilesystemListOpts
Options for the sandbox filesystem operations.Properties
depth?
requestTimeoutMs?
Default
user?
FilesystemRequestOpts
Options for the sandbox filesystem operations.Extended by
FilesystemListOptsWatchOpts
Properties
requestTimeoutMs?
Default
user?
WatchOpts
Options for watching a directory.Properties
onExit()?
Parameters
Returns
void | Promise<void>
recursive?
requestTimeoutMs?
Default
timeoutMs?
0 to disable the timeout.
Default
user?
WriteInfo
Sandbox filesystem object information.Extended by
EntryInfo