engine

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FilePath string

FilePath is the file being processed, empty if stdin.

View Source
var Stdlib string

Functions

func Body

func Body(args []string, i int) string

func JS

func JS(args []string) string

func NewVM

func NewVM(writeOut func(string)) *goja.Runtime

func Quote

func Quote(s string) string

func Start

func Start(parser Parser, args []string, opts Options) int

func Stringify

func Stringify(value goja.Value, vm *goja.Runtime, depth int) string

Types

type ExitError

type ExitError struct {
	Code int
}

ExitError is used by exit() to signal a specific exit code.

type Options

type Options struct {
	Slurp      bool
	WithInline bool
	WriteOut   func(string)
	WriteErr   func(string)
}

type Parser

type Parser interface {
	Parse() (*jsonx.Node, error)
	Recover() *jsonx.Node
}

func Slurp

func Slurp(parser Parser, writeErr func(string)) (Parser, bool)

Jump to

Keyboard shortcuts

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