ScriptEngine
engines ScriptEngine
Represents a running script or project execution. You can communicate across engines, inspect state, stop execution, and more.
Inheritance
ScriptEngine
Table of contents
Properties
Methods
Properties
executionConfig
executionConfig:ReadOnlyExecutionConfig(read-only)
Execution configuration for this run.
id
id:number(read-only)
Unique engine id. No two engines share the same id.
source
source:any(read-only)
Module object for the engine’s main script.
sourceFile
sourceFile:string(read-only)
Path to the engine’s main script file.
workingDirectory
workingDirectory:string(read-only)
Working directory—usually the project root or the script file’s parent folder.
Methods
emit
emit(event: string, ...args: any[]): void
Emit an event on this engine. For the Node.js engine use require("engines").myEngine().on("event_name", () => {}); on the Pro 8 engine use $events.on("event_name", () => {}).
Parameters
event: Event name....args: Payload; values must be JSON-serializable.
Returns
void
forceStop
forceStop(): void
Forcibly stops the engine.
Returns
void
getTag
getTag(key: string): any
Returns metadata stored on this engine under key.
Example
"nodejs";
const { myEngine } = require("engines");
const tag = myEngine().getTag("myTag");
console.log("Tag value:", tag);Parameters
key: Tag key.
Returns
any
Stored value, or undefined if unset.
