MCPcopy Create free account
hub / github.com/buke/quickjs-go / WithModuleImport

Function WithModuleImport

runtime.go:482–486  ·  view source on GitHub ↗

WithModuleImport installs or clears the default quickjs-libc file/module loader. When enabled, import/export resolution can load modules via quickjs-ng's default loader. When disabled, module resolution fails closed unless another loader is installed.

(moduleImport bool)

Source from the content-addressed store, hash-verified

480// When enabled, import/export resolution can load modules via quickjs-ng's default loader.
481// When disabled, module resolution fails closed unless another loader is installed.
482func WithModuleImport(moduleImport bool) Option {
483 return func(o *Options) {
484 o.moduleImport = moduleImport
485 }
486}
487
488// WithStripInfo is retained for backward compatibility only.
489// Deprecated: quickjs-ng does not expose a runtime-level strip-info API, so this option is a no-op.

Calls

no outgoing calls