js

package
v0.16.2 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Compile     = goja.Compile
	MustCompile = goja.MustCompile
	IsNaN       = goja.IsNaN
	IsString    = goja.IsString
	IsBigInt    = goja.IsBigInt
	IsNumber    = goja.IsNumber
	IsInfinity  = goja.IsInfinity
	IsUndefined = goja.IsUndefined
	IsNull      = goja.IsNull
)

Function aliases from goja for script compilation and type checking.

Functions

This section is empty.

Types

type AstProgram

type AstProgram = ast.Program

Type aliases from goja for convenient access.

func Parse

func Parse(name, src string) (*AstProgram, error)

Parse parses JavaScript source code into an AST.

type Object

type Object = goja.Object

Type aliases from goja for convenient access.

type Program

type Program = goja.Program

Type aliases from goja for convenient access.

type Runtime

type Runtime = goja.Runtime

Type aliases from goja for convenient access.

func New

func New() (vm *Runtime, err error)

New creates a new JavaScript runtime with preloaded standard libraries.

The runtime is configured with:

  • Source maps disabled for better performance
  • JSON struct tag mapping for Go-JavaScript interop
  • Global libraries: dayjs, Big, utils, validator

Returns an error if any library fails to load.

WARNING: The returned Runtime is NOT thread-safe. Each goroutine should create its own runtime instance.

type Value

type Value = goja.Value

Type aliases from goja for convenient access.

Jump to

Keyboard shortcuts

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