Skip to content

ObsidianTransport.evaluate method

ObsidianTransport › evaluate

Evaluates a JavaScript expression string inside Obsidian and returns the raw string result.

The transport normalizes the output — stripping transport-specific prefixes and handling transport-specific errors — so callers receive a clean result string (e.g. a JSON string, or (no output)).

Signature:

evaluate(expression: string, options: TransportEvalOptions): Promise<string>

Parameters:

ParameterTypeDescription
expressionstringA self-contained JavaScript expression (typically an async IIFE).
optionsTransportEvalOptionsEvaluation options including the working directory.

Returns: Promise<string>The raw result string from Obsidian.