modules

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package modules contains additional JS modules exported into the runtime

Index

Constants

This section is empty.

Variables

View Source
var Base64 = &Base64module{}

Base64 module provides functions to encode/decode strings to Base64

Example (js):

const encoded = btoa('hello'); const decoded = atob(encoded);

Functions

This section is empty.

Types

type Base64module

type Base64module struct{}

func (*Base64module) Enable

func (b *Base64module) Enable(runtime *goja.Runtime)

type RuntimeModule

type RuntimeModule struct {
	// Name of the module as it can be seen from the JS runtime
	Name string

	// The content of the module. Can be any type.
	Module interface{}
}

RuntimeModule is a container for modules

func (*RuntimeModule) Register

func (m *RuntimeModule) Register(vm *goja.Runtime) error

Register exports the module into JS runtime

Jump to

Keyboard shortcuts

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