Skip to main content
You are currently viewing documentation for version 2.3.0 of the E2B SDK (JavaScript).View the latest version of this page.

ReadyCmd

Class for ready check commands.

Constructors

Parameters
Returns
ReadyCmd

Methods

getCmd()

Returns
string

Functions

waitForFile()

Wait for a file to exist. Uses shell test command to check file existence.

Parameters

Returns

ReadyCmd ReadyCmd that checks for the file

Example


waitForPort()

Wait for a port to be listening. Uses ss command to check if a port is open and listening.

Parameters

Returns

ReadyCmd ReadyCmd that checks for the port

Example


waitForProcess()

Wait for a process with a specific name to be running. Uses pgrep to check if a process exists.

Parameters

Returns

ReadyCmd ReadyCmd that checks for the process

Example


waitForTimeout()

Wait for a specified timeout before considering the sandbox ready. Uses sleep command to wait for a fixed duration.

Parameters

Returns

ReadyCmd ReadyCmd that waits for the specified duration

Example


waitForURL()

Wait for a URL to return a specific HTTP status code. Uses curl to make HTTP requests and check the response status.

Parameters

Returns

ReadyCmd ReadyCmd that checks the URL

Example