Skip to main content
Accessed via sandbox.files.

sandbox.files.read(path)

Read a file as a UTF-8 string. HTTP API →
path
string
required
Absolute path to the file
Returns: Promise<string>

sandbox.files.readBytes(path)

Read a file as raw bytes.
path
string
required
Absolute path to the file
Returns: Promise<Uint8Array>

sandbox.files.write(path, content)

Write content to a file. HTTP API →
path
string
required
Absolute path for the destination file
content
string | Uint8Array
required
File content
Returns: Promise<void>

sandbox.files.list(path?)

List directory contents. HTTP API →
path
string
default:"/"
Directory path
Returns: Promise<EntryInfo[]>

sandbox.files.makeDir(path)

Create a directory (recursive). HTTP API →
path
string
required
Directory path
Returns: Promise<void>

sandbox.files.remove(path)

Delete a file or directory. HTTP API →
path
string
required
Path to remove
Returns: Promise<void>

sandbox.files.exists(path)

Check if a path exists. Client-side wrapper — attempts a read and returns false on error.
path
string
required
Path to check
Returns: Promise<boolean>

Types

interface EntryInfo {
  name: string;
  isDir: boolean;
  path: string;
  size: number;
}