{"id":16862367,"url":"https://github.com/dave/wasmgo","last_synced_at":"2025-10-18T17:46:59.350Z","repository":{"id":57480678,"uuid":"144758081","full_name":"dave/wasmgo","owner":"dave","description":"Compiles Go to WASM and deploys to the jsgo.io CDN","archived":false,"fork":false,"pushed_at":"2023-03-07T00:43:48.000Z","size":840,"stargazers_count":145,"open_issues_count":4,"forks_count":13,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-02-27T18:27:23.549Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dave.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-14T18:31:36.000Z","updated_at":"2025-01-14T07:32:50.000Z","dependencies_parsed_at":"2024-06-19T00:01:39.280Z","dependency_job_id":"424729af-4ff9-4f08-88e3-94a838a3500a","html_url":"https://github.com/dave/wasmgo","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dave%2Fwasmgo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dave%2Fwasmgo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dave%2Fwasmgo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dave%2Fwasmgo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dave","download_url":"https://codeload.github.com/dave/wasmgo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243846984,"owners_count":20357297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T14:35:17.799Z","updated_at":"2025-10-18T17:46:54.310Z","avatar_url":"https://github.com/dave.png","language":"Go","readme":"\u003ca href=\"https://patreon.com/davebrophy\" title=\"Help with my hosting bills using Patreon\"\u003e\u003cimg src=\"https://img.shields.io/badge/patreon-donate-yellow.svg\" style=\"max-width:100%;\"\u003e\u003c/a\u003e\n\n# wasmgo\n\nThe `wasmgo` command compiles Go to WASM, and serves the binary locally or deploys to the [jsgo.io](https://github.com/dave/jsgo) CDN.\n\n### Install\n\n```\ngo get -u github.com/dave/wasmgo\n```\n\n### Serve command\n\n```\nwasmgo serve [flags] [package]\n```\n\nServes the WASM with a local web server (default to port 8080). Refresh the browser to recompile.\n\n### Deploy command\n\n```\nwasmgo deploy [flags] [package]\n```\n\nDeploys the WASM to the [jsgo.io](https://github.com/dave/jsgo) CDN.\n\n### Global flags\n\n```\n-b, --build string     Build tags to pass to the go build command.\n-c, --command string   Name of the go command. (default \"go\")\n-f, --flags string     Flags to pass to the go build command.\n-h, --help             help for wasmgo\n-i, --index string     Specify the index page template. Variables: Script, Loader, Binary. (default \"index.wasmgo.html\")\n-o, --open             Open the page in a browser. (default true)\n-v, --verbose          Show detailed status messages.\n```\n\n### Deploy flags\n\n```\n-j, --json              Return all template variables as a json blob from the deploy command.\n-t, --template string   Template defining the output returned by the deploy command. Variables: Page, Script, Loader, Binary. (default \"{{ .Page }}\")\n```\n\n### Serve flags\n\n```\n-p, --port int   Server port. (default 8080)\n```\n\n### Package\n\nOmit the package argument to use the code in the current directory.\n\n### Examples\n\nHere's a simple hello world:\n\n```\nwasmgo serve github.com/dave/wasmgo/helloworld\n```\n\nThe page (http://localhost:8080/) opens in a browser.\n\nHere's an amazing 2048 clone from [hajimehoshi](https://github.com/hajimehoshi):\n\n```\ngo get -u github.com/hajimehoshi/ebiten/examples/2048/...\nwasmgo deploy -b=example github.com/hajimehoshi/ebiten/examples/2048\n```\n\n[The deployed page](https://jsgo.io/2893575ab26da60ef14801541b46201c9d54db13) opens in a browser.\n\n### Index\n\nYou may specify a custom index page by including `index.wasmgo.html` in your project or by using the `index` \ncommand line flag.\n\nYour index page should look something like this:\n\n```html\n\u003chtml\u003e\n\u003chead\u003e\u003cmeta charset=\"utf-8\"\u003e\u003c/head\u003e\n\u003cbody\u003e\n\t\u003cscript src=\"{{ .Script }}\"\u003e\u003c/script\u003e\n\t\u003cscript src=\"{{ .Loader }}\"\u003e\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n### Template variables\n\nThe index page template and the `-t` flag are both Go templates with several variables available:\n\n* *Page*  \n  The URL of the page on jsgo.io (deploy command output only).  \n  \n* *Script*  \n  To load and execute a WASM binary, a some JS bootstap code is required. The wasmgo command uses a minified \n  version of the [example in the official Go repo](https://github.com/golang/go/blob/master/misc/wasm/wasm_exec.js). \n  The URL of this script is the `Script` template variable.  \n\n* *Loader*  \n  The loader JS is a simple script that loads and executes the WASM binary. It's based on the [example \n  in the official Go repo](https://github.com/golang/go/blob/master/misc/wasm/wasm_exec.html#L17-L36), \n  but simplified to execute the program immediately instead. The URL of this script is the `Loader` template variable.         \n  \n* *Binary*  \n  The URL of the WASM binary file.  \n\n### Static files\n\nUnfortunately wasmgo does not host your static files. I recommend using [rawgit.com](https://rawgit.com/) \nto serve static files. \n\n### Package splitting\n\nThe `wasmgo deploy` can't yet split the binary output by Go package, [can you help?](https://github.com/dave/wasmgo/issues/2) ","funding_links":["https://patreon.com/davebrophy"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdave%2Fwasmgo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdave%2Fwasmgo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdave%2Fwasmgo/lists"}