Class: Tcl

Tcl

new Tcl()

Tcl Interpreter bridge
Source:

Methods

$()

Alias for Tcl#cmdSync
Source:
See:

$inject()

Inject Tcl commands (returned by `info commands`) as javascript functions into the object.
Source:

cmd(cmd, callback)

Execute a Tcl command using the Tcl Interpreter binding. This is an asynchronous call and a new Tcl Interpreter instance is used for each execution.
Parameters:
Name Type Description
cmd string command to execute
callback Tcl~cmdCallback callback method to handle the response
Source:

cmdSync(cmd) → {Result}

Execute a Tcl command synchronously using the Tcl Interpreter binding. This will use a shared Tcl Interpreter and can share data between two executions (e.g. global variable, loaded libraries etc.)
Parameters:
Name Type Description
cmd string Command to execute
Source:
Throws:
Error object containing error data
Type
Error
Returns:
Result object containing response data
Type
Result

eval()

Alias for Tcl#cmd
Source:
See:

evalSync()

Alias for Tcl#cmdSync
Source:
See:

load()

load a Tcl module and refresh internal Tcl command references
Source:

queue(cmd, callback)

Add a Tcl command to the asynchronous processing queue. Each command added will be executed using a single worker thread outside of the main event loop. Each command shares the same worker thread and the Tcl interpreter instance and will share states.
Parameters:
Name Type Description
cmd string command to execute
callback Tcl~cmdCallback callback method to handle the response
Source:

source()

Source a Tcl script and refresh internal Tcl command references
Source:

version() → {string}

Returns the Tcl Interpreter version
Source:
Returns:
Tcl version
Type
string

Type Definitions

cmdCallback(err, result)

Error first callback method to return error and response data after executing a Tcl command asynchronously
Parameters:
Name Type Description
err Error | null JavaScript Error object with error details upon error or null
result Result object containing response data from the executed Tcl command
Source: