tsembed

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

README

TSEmbed

Library that makes it super easy to embed typescript as a scripting language in your go application.

Under the hood it uses ESBuild to compile the typescript code to ES5 and then runs it using GoJa.

TODO: consider open sourcing this package as a standalone library.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TsonTransform = api.Plugin{
	Name: "tsonTransform",
	Setup: func(build api.PluginBuild) {
		build.OnLoad(
			api.OnLoadOptions{Filter: `\.tson$`},
			loadTSON,
		)
	},
}

Functions

func Build

func Build(entrypoint string) ([]byte, error)

func Eval

func Eval(entrypoint string) (goja.Value, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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