SelfScriptEngine
engines SelfScriptEngine
The script engine that is running the current script.
Inheritance
↳
SelfScriptEngine
Table of contents
Properties
Methods
- addListener
- emit
- eventNames
- forceStop
- getMaxListeners
- getTag
- listenerCount
- listeners
- off
- on
- once
- prependListener
- prependOnceListener
- rawListeners
- removeAllListeners
- removeListener
- setMaxListeners
Properties
execArgv
execArgv:any(read-only)
Execution arguments: options passed when another script started this engine, or payload from timed / intent tasks (for example { intent: ... }).
executionConfig
executionConfig:ReadOnlyExecutionConfig(read-only)
Execution configuration for this run.
Inherited from
id
id:number(read-only)
Unique engine id. No two running engines share the same id.
Inherited from
source
source:any(read-only)
Engine source module object.
Inherited from
sourceFile
sourceFile:string(read-only)
Path to the engine’s main script file.
Inherited from
workingDirectory
workingDirectory:string(read-only)
Working directory for this engine—usually the project root or the parent folder of the script file.
Inherited from
Methods
addListener
addListener(event: string, listener: (...args: any[]) => void): SelfScriptEngine`
Parameters
event: Event name.listener: Callback invoked when the event is emitted.
Returns
Inherited from
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 you can use $events.on("event_name", () => {}).
Parameters
event: Event name....args: Payload; each value must be JSON-serializable.
Returns
void
Inherited from
eventNames
eventNames(): string[]
Returns
string[]
Inherited from
forceStop
forceStop(): void
Forcibly stops the engine.
Returns
void
Inherited from
getMaxListeners
getMaxListeners(): number
Returns
number
Inherited from
EngineEventTarget.getMaxListeners
getTag
getTag(key: string): any
Returns metadata attached to 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.
Inherited from
listenerCount
listenerCount(event: string): number
Parameters
event: Event name.
Returns
number
Inherited from
EngineEventTarget.listenerCount
listeners
listeners(event: string): Function[]
Parameters
event: Event name.
Returns
Function[]
Inherited from
off
off(event: string, listener: (...args: any[]) => void): SelfScriptEngine`
Parameters
event: Event name.listener: Same function reference passed toon/addListener.
Returns
Inherited from
on
on(event: string, listener: (...args: any[]) => void): SelfScriptEngine`
Parameters
event: Event name.listener: Callback.
Returns
Inherited from
once
once(event: string, listener: (...args: any[]) => void): SelfScriptEngine`
Parameters
event: Event name.listener: Callback; runs at most once.
Returns
Inherited from
prependListener
prependListener(event: string, listener: (...args: any[]) => void): SelfScriptEngine`
Parameters
event: Event name.listener: Callback inserted at the front of the listener list.
Returns
Inherited from
EngineEventTarget.prependListener
prependOnceListener
prependOnceListener(event: string, listener: (...args: any[]) => void): SelfScriptEngine`
Parameters
event: Event name.listener: One-shot callback prepended to the list.
Returns
Inherited from
EngineEventTarget.prependOnceListener
rawListeners
rawListeners(event: string): Function[]
Parameters
event: Event name.
Returns
Function[]
Inherited from
EngineEventTarget.rawListeners
removeAllListeners
removeAllListeners(event?: string): SelfScriptEngine`
Parameters
event: Optional; if omitted, all events are cleared.
Returns
Inherited from
EngineEventTarget.removeAllListeners
removeListener
removeListener(event: string, listener: (...args: any[]) => void): SelfScriptEngine`
Parameters
event: Event name.listener: Listener to remove.
Returns
Inherited from
EngineEventTarget.removeListener
setMaxListeners
setMaxListeners(n: number): SelfScriptEngine`
Parameters
n: Maximum listeners per event before a warning is logged.
