Documentation
¶
Overview ¶
Package rt provides a JavaScript runtime for hydris plugins using goja.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindDataDir ¶
FindDataDir walks up from path to find the directory containing package.json. Returns empty string if not found.
Types ¶
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
Runtime wraps a goja event loop with the globals needed by hydris plugins.
func New ¶
New creates a Runtime. dataDir is the plugin's source directory (containing package.json) used to sandbox file access. The event loop provides setTimeout/setInterval, console, and CommonJS require out of the box via goja_nodejs. Node.js-compatible http2, events, stream modules are registered so that connect-rpc bundles work without modification.
Click to show internal directories.
Click to hide internal directories.