Provides access to the Ghost runtime.
Creates a new runtime error and outputs the specified message. If the passed value is
null no runtime error is generated.
ghost.abort("A critical error was encountered. Aborting.") // expected output: A critical error was encountered. Aborting.
Executes Ghost code represented as a string. The string representation can include variables and properties of existing objects.
print(ghost.execute('2 + 2')) // expected output: 4
Registers and executes a plugin compiled through Go, allowing the ability to dynamically extend Ghost with new native functionality. Plugins must be compiled against both the exact version of Ghost, and the version of Go used to compile Ghost.
|Ghost Version||Go Version|
To compile a plugin with Go, use the
-buildmode=plugin build flag:
$ go build -buildmode=plugin -o example.so main.go
Returns a list of all identifieris within the current scope.
Returns the current version of Ghost.