Zaidlang
Search
⌃K
🙆

Zaid

Provides access to the Zaidlang runtime.

Methods

zaid.abort()

Creates a new runtime error and outputs the specified message. If the passed value is null no runtime error is generated.
zaid.abort("A critical error was encountered. Aborting.")
​
// expected output: A critical error was encountered. Aborting.

zaid.execute()

Executes Zaidlang code represented as a string. The string representation can include variables and properties of existing objects.
printftw(zaid.execute('2 + 2'))
​
// expected output: 4

zaid.extend()

Registers and executes a plugcompiled 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
1.0
1.17.5
To compile a plugin with Go, use the -buildmode=plugin build flag:
$ go build -buildmode=plugin -o example.so main.go
zaid.extend('./example.so')

zaid.identifiers()

Returns a list of all identifieris within the current scope.
zaid.identifiers()

Properties

zaid.version

Returns the current version of Ghost.
zaid.version