js

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2026 License: Apache-2.0 Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Display

func Display(v goja.Value) string

func RandomCity

func RandomCity() string

func RandomColor

func RandomColor() string

func RandomCountry

func RandomCountry() string

func RandomEmail

func RandomEmail() string

func RandomNumber

func RandomNumber(length int) string

func RandomPersonName

func RandomPersonName() string

func RandomText

func RandomText(length int) string

func Truthy

func Truthy(s string) bool

Types

type Engine

type Engine struct {
	Log func(string)

	ScriptDir string
	// contains filtered or unexported fields
}

func New

func New(platform string) *Engine

func (*Engine) Eval

func (e *Engine) Eval(src string, sc *Scope) (goja.Value, error)

func (*Engine) Interpolate

func (e *Engine) Interpolate(s string, sc *Scope) (string, error)

func (*Engine) Output

func (e *Engine) Output() map[string]any

func (*Engine) RunScript

func (e *Engine) RunScript(src, dir string, sc *Scope) error

type Error

type Error struct {
	Msg    string
	Syntax bool
}

func (*Error) Error

func (e *Error) Error() string

type Scope

type Scope struct {
	Env        map[string]string
	Platform   string
	CopiedText *string
	Log        func(string)
}

Jump to

Keyboard shortcuts

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