Versions in this module Expand all Collapse all v1 v1.0.1 Sep 25, 2023 Changes in this version + const NodePrefix + var IllegalModuleNameError = errors.New("Illegal module name") + var InvalidModuleError = errors.New("Invalid module") + var ModuleFileDoesNotExistError = errors.New("module file does not exist") + var NoSuchBuiltInModuleError = errors.New("No such built-in module") + func DefaultSourceLoader(filename string) ([]byte, error) + func RegisterCoreModule(name string, loader ModuleLoader) + func RegisterNativeModule(name string, loader ModuleLoader) + func Require(runtime *js.Runtime, name string) js.Value + type ModuleLoader func(*js.Runtime, *js.Object) + type Option func(*Registry) + func WithGlobalFolders(globalFolders ...string) Option + func WithLoader(srcLoader SourceLoader) Option + type Registry struct + func NewRegistry(opts ...Option) *Registry + func NewRegistryWithLoader(srcLoader SourceLoader) *Registry + func (r *Registry) Enable(runtime *js.Runtime) *RequireModule + func (r *Registry) RegisterNativeModule(name string, loader ModuleLoader) + type RequireModule struct + func (r *RequireModule) Require(p string) (ret js.Value, err error) + type SourceLoader func(path string) ([]byte, error)