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()
Call Signature
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
Call Signature
Uint8Array.
You can pass text, bytes, blob, or stream to opts.format to change the return type.
Parameters
Returns
Promise<Uint8Array<ArrayBufferLike>>
file content as Uint8Array
Call Signature
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
Call Signature
ReadableStream.
You can pass text, bytes, blob, or stream to opts.format to change the return type.
Parameters
Returns
Promise<ReadableStream<Uint8Array<ArrayBufferLike>>>
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()
Call Signature
Parameters
Returns
Promise<WriteInfo>
information about the written file
Call Signature
Parameters
Returns
Promise<WriteInfo[]>
information about the written file
writeFiles()
Parameters
Returns
Promise<WriteInfo[]>
information about the written files
Interfaces
EntryInfo
Sandbox filesystem object information.Properties
group
metadata?
user.e2b.* extended
attributes. On writes this reflects the metadata supplied on upload; on
reads (getInfo, list, rename) it reflects any user.e2b.* xattr on
the file, including ones set out-of-band. undefined when none is set.
mode
modifiedTime?
name
owner
path
permissions
size
symlinkTarget?
type?
FilesystemListOpts
Options for the sandbox filesystem operations.Properties
depth?
requestTimeoutMs?
Default
signal?
AbortSignal that can be used to cancel the in-flight request.
When the signal is aborted, the underlying fetch is aborted and the
returned promise rejects with an AbortError.
user?
FilesystemReadOpts
Options for reading files from the sandbox filesystem.Properties
gzip?
requestTimeoutMs?
Default
signal?
AbortSignal that can be used to cancel the in-flight request.
When the signal is aborted, the underlying fetch is aborted and the
returned promise rejects with an AbortError.
user?
FilesystemRequestOpts
Options for the sandbox filesystem operations.Extended by
FilesystemWriteOptsFilesystemReadOptsFilesystemListOptsWatchOpts
Properties
requestTimeoutMs?
Default
AbortSignal that can be used to cancel the in-flight request.
When the signal is aborted, the underlying fetch is aborted and the
returned promise rejects with an AbortError.
FilesystemWriteOpts
Options for writing files to the sandbox filesystem.Properties
gzip?
metadata?
InvalidArgumentError.
The same metadata is applied to every file in a multi-file upload.
Requires envd 0.6.2 or later.
requestTimeoutMs?
Default
signal?
AbortSignal that can be used to cancel the in-flight request.
When the signal is aborted, the underlying fetch is aborted and the
returned promise rejects with an AbortError.
useOctetStream?
application/octet-stream instead of multipart/form-data.
Defaults to false. Requires envd 0.5.7 or later — when not supported by
the sandbox’s envd version, the upload falls back to multipart/form-data.
user?
WatchOpts
Options for watching a directory.Properties
includeEntry?
undefined for events where the
entry no longer exists at the path (e.g. remove or rename-away events).
Requires envd 0.6.3 or later. Watching with this option against an older sandbox
throws a TemplateError.
onExit()?
Parameters
Returns
void | Promise<void>
recursive?
requestTimeoutMs?
Default
signal?
AbortSignal that can be used to cancel the in-flight request.
When the signal is aborted, the underlying fetch is aborted and the
returned promise rejects with an AbortError.
timeoutMs?
0 to disable the timeout.
Default
user?
WriteInfo
Sandbox filesystem object information.Extended by
EntryInfo
Properties
metadata?
user.e2b.* extended
attributes. On writes this reflects the metadata supplied on upload; on
reads (getInfo, list, rename) it reflects any user.e2b.* xattr on
the file, including ones set out-of-band. undefined when none is set.
name
path
type?
Type Aliases
WriteEntry
Type declaration
Functions
mapEntryInfo()
EntryInfo to the SDK EntryInfo.
Parameters
Returns
EntryInfo