Skip to main content

Class: CurrentModule

Reflective module API provided to functions at runtime.

Extends​

  • BaseClient

Constructors​

Constructor​

new CurrentModule(ctx?, _id?, _name?): CurrentModule

Constructor is used for internal usage only, do not create object from it.

Parameters​

ctx?​

Context

_id?​

CurrentModuleID

_name?​

string

Returns​

CurrentModule

Overrides​

BaseClient.constructor

Methods​

id()​

id(): Promise<CurrentModuleID>

A unique identifier for this CurrentModule.

Returns​

Promise<CurrentModuleID>


name()​

name(): Promise<string>

The name of the module being executed in

Returns​

Promise<string>


source()​

source(): Directory

The directory containing the module's source code loaded into the engine (plus any generated code that may have been created).

Returns​

Directory


workdir()​

workdir(path, opts?): Directory

Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.

Parameters​

path​

string

Location of the directory to access (e.g., ".").

opts?​

CurrentModuleWorkdirOpts

Returns​

Directory


workdirFile()​

workdirFile(path): File

Load a file from the module's scratch working directory, including any changes that may have been made to it during module function execution.Load a file from the module's scratch working directory, including any changes that may have been made to it during module function execution.

Parameters​

path​

string

Location of the file to retrieve (e.g., "README.md").

Returns​

File