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

Method Export

module.go:48–54  ·  view source on GitHub ↗

Export adds an export to the module This is the core method that handles all types of exports including default For default export, use name="default" Deprecated: Use ExportValue or ExportLiteral for declarative, reusable module definitions.

(name string, value *Value)

Source from the content-addressed store, hash-verified

46// For default export, use name="default"
47// Deprecated: Use ExportValue or ExportLiteral for declarative, reusable module definitions.
48func (mb *ModuleBuilder) Export(name string, value *Value) *ModuleBuilder {
49 var spec ValueSpec
50 if value != nil {
51 spec = contextValueSpec{value: value}
52 }
53 return mb.ExportValue(name, spec)
54}
55
56// ExportValue adds an export ValueSpec to the module.
57func (mb *ModuleBuilder) ExportValue(name string, spec ValueSpec) *ModuleBuilder {

Calls 1

ExportValueMethod · 0.95