runtime

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EventLoop = &sync.WaitGroup{}

Global wait group to manage the event loop

Functions

func ChildProcess

func ChildProcess(vm *goja.Runtime, module *goja.Object)

func Console

func Console(vm *goja.Runtime, module *goja.Object)

console provides console.log, console.warn, console.error, console.debug, console.info, console.red, console.green, console.yellow, console.color.

console.log, console.warn, console.error, console.debug, console.info are plain loggers.

console.red, console.green, console.yellow are colored loggers.

console.color is a flexible color logger. It takes multiple arguments where the last argument is the color name and the rest of the arguments are the text parts.

Example: console.color("This is a", "red", " warning!")

func FS

func FS(vm *goja.Runtime, module *goja.Object)

func GetDataFromMetadata

func GetDataFromMetadata(key string) (string, error)

Get metadata from metadata.json

func LoadEnvWithPrefix

func LoadEnvWithPrefix(baseDir string) map[string]string

func NewRuntime

func NewRuntime() *goja.Runtime

func OS

func OS(vm *goja.Runtime, module *goja.Object)

func Path

func Path(vm *goja.Runtime, module *goja.Object)

func Prasmoid

func Prasmoid(vm *goja.Runtime, module *goja.Object)

func Process

func Process(vm *goja.Runtime, module *goja.Object)

func Register

func Register(vm *goja.Runtime, name string, module func(vm *goja.Runtime, module *goja.Object))

func SetObjProperty added in v0.0.4

func SetObjProperty(obj *goja.Object, key string, value interface{})

Types

type CommandConfig

type CommandConfig struct {
	Run   goja.Callable `json:"-"`
	Short string        `json:"short"`
	Long  string        `json:"long"`
	Alias []string      `json:"alias"`
	Flags []CommandFlag `json:"flags"`
}

CommandConfig represents the configuration for a command

var CommandStorage CommandConfig

CommandStorage stores the command configuration globally

type CommandFlag

type CommandFlag struct {
	Name        string      `json:"name"`
	Type        string      `json:"type"`
	Value       interface{} `json:"value"`
	Shorthand   string      `json:"shorthand"`
	Description string      `json:"description"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL