# wasmgo
**Repository Path**: mirrors_dave/wasmgo
## Basic Information
- **Project Name**: wasmgo
- **Description**: Compiles Go to WASM and deploys to the jsgo.io CDN
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2020-11-23
- **Last Updated**: 2026-05-17
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# wasmgo
The `wasmgo` command compiles Go to WASM, and serves the binary locally or deploys to the [jsgo.io](https://github.com/dave/jsgo) CDN.
### Install
```
go get -u github.com/dave/wasmgo
```
### Serve command
```
wasmgo serve [flags] [package]
```
Serves the WASM with a local web server (default to port 8080). Refresh the browser to recompile.
### Deploy command
```
wasmgo deploy [flags] [package]
```
Deploys the WASM to the [jsgo.io](https://github.com/dave/jsgo) CDN.
### Global flags
```
-b, --build string Build tags to pass to the go build command.
-c, --command string Name of the go command. (default "go")
-f, --flags string Flags to pass to the go build command.
-h, --help help for wasmgo
-i, --index string Specify the index page template. Variables: Script, Loader, Binary. (default "index.wasmgo.html")
-o, --open Open the page in a browser. (default true)
-v, --verbose Show detailed status messages.
```
### Deploy flags
```
-j, --json Return all template variables as a json blob from the deploy command.
-t, --template string Template defining the output returned by the deploy command. Variables: Page, Script, Loader, Binary. (default "{{ .Page }}")
```
### Serve flags
```
-p, --port int Server port. (default 8080)
```
### Package
Omit the package argument to use the code in the current directory.
### Examples
Here's a simple hello world:
```
wasmgo serve github.com/dave/wasmgo/helloworld
```
The page (http://localhost:8080/) opens in a browser.
Here's an amazing 2048 clone from [hajimehoshi](https://github.com/hajimehoshi):
```
go get -u github.com/hajimehoshi/ebiten/examples/2048/...
wasmgo deploy -b=example github.com/hajimehoshi/ebiten/examples/2048
```
[The deployed page](https://jsgo.io/2893575ab26da60ef14801541b46201c9d54db13) opens in a browser.
### Index
You may specify a custom index page by including `index.wasmgo.html` in your project or by using the `index`
command line flag.
Your index page should look something like this:
```html