{"id":16862331,"url":"https://github.com/dave/play","last_synced_at":"2025-03-22T06:32:02.858Z","repository":{"id":57480693,"uuid":"126356825","full_name":"dave/play","owner":"dave","description":"jsgo playground: edit and run Go code in the browser, supporting arbitrary import paths","archived":false,"fork":false,"pushed_at":"2020-03-06T00:02:55.000Z","size":162,"stargazers_count":50,"open_issues_count":2,"forks_count":8,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-18T09:05:08.962Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://play.jsgo.io/","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}},"created_at":"2018-03-22T15:34:49.000Z","updated_at":"2023-03-18T17:19:59.000Z","dependencies_parsed_at":"2022-09-26T17:41:19.812Z","dependency_job_id":null,"html_url":"https://github.com/dave/play","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dave%2Fplay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dave%2Fplay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dave%2Fplay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dave%2Fplay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dave","download_url":"https://codeload.github.com/dave/play/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244918499,"owners_count":20531683,"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:12.602Z","updated_at":"2025-03-22T06:31:57.845Z","avatar_url":"https://github.com/dave.png","language":"Go","funding_links":["https://patreon.com/davebrophy"],"categories":[],"sub_categories":[],"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# 2020 Update\n\n* The compile.jsgo.io and play.jsgo.io services have been shut down.   \n* Anything deployed to jsgo.io or pkg.jsgo.io will continue to work fine.  \n\nI created the jsgo.io system several years ago, and it costs about $150/month to host which I pay \npersonally. I'm tightening up my finances right now, so this outgoing had to stop.\n\nIf anyone would like to host it for me (it runs on a single GKE `n1-standard-2` instance), please \nlet me know and we can get it back online!\n\nI had a plan for a big rewrite that would make is possible to run on App Engine, thus reduce the \ncost to almost zero. Unfortunately this is something I'm hesitant to start, because it seems that \nGo on the client is moving away from GopherJS and towards WASM.  \n\n# play.jsgo.io\n\nEdit and run Go in the browser, supporting arbitrary import paths!\n\nhttps://play.jsgo.io/\n\n[\u003cimg width=\"500\" alt=\"title936803092\" src=\"https://user-images.githubusercontent.com/925351/39423295-7b461464-4c71-11e8-9565-6c860e8642e8.png\"\u003e](https://play.jsgo.io/)\n\nThe jsgo playground is an extension of the jsgo compiler. The compiler allows you to easily compile Go \nto JS using GopherJS, and automatically host the results in an aggressively cached CDN. The playground \nadds an online editor and many other features (see below).\n\nThe unique feature of the jsgo playground is that it supports arbitrary import paths. Other Go playgrounds \nare limited to just the Go standard library.\n\nFor more for more info:\n\n* jsgo compiler: https://github.com/dave/jsgo  \n* jsgo playground: https://github.com/dave/play  \n\n## Demos\n\nHere's the simplest demo - it just writes to the console and to the page:  \n\n* https://play.jsgo.io/github.com/dave/jstest\n\nHere's a couple of simple demos that accept files by drag and drop. The first compresses dropped files to \na zip. The second compresses images to jpg. They use the Go standard library zip / image libraries, which \nwork flawlessly in the browser:   \n\n* https://play.jsgo.io/github.com/dave/zip\n* https://play.jsgo.io/github.com/dave/img \n\nThe amazing ebiten 2D games library is a perfect example of the power of Go in the browser. Here's some \ndemos: \n\n* https://play.jsgo.io/github.com/hajimehoshi/ebiten/examples/2048\n* https://play.jsgo.io/github.com/hajimehoshi/go-inovation\n* https://play.jsgo.io/github.com/hajimehoshi/ebiten/examples/flappy\n\n## Contact\n\nIf you'd like to chat more about the project, feel free to [add an issue](https://github.com/dave/play/issues), \nmention [@dave](https://github.com/dave/) or post in the #gopherjs channel of the Gophers Slack. I'm \nhappy to help!\n\n## Features\n\n#### Initialise\nThe URL can be used to initialise with code in several ways:\n\n* Load a Go package with `/{{ Package path }}`\n* Load a Github Gist with `/gist.github.com/{{ Gist ID }}`\n* Load a shared project with `/{{ Share ID }}`\n* Load a `play.golang.org` share with `/p/{{ Go playground ID }}`\n\n\u003cimg align=\"right\" width=\"150\" alt=\"run\" src=\"https://user-images.githubusercontent.com/925351/39422110-550c650a-4c6c-11e8-9353-050f823c6201.png\"\u003e\n\n#### Run\nClick the `Run` button to run your code in the right-hand panel. If the imports have been changed recently,\nthe dependencies will be refreshed before running.\n\n\u003ctable\u003e\u003c/table\u003e\n\n\u003cimg align=\"right\" width=\"150\" alt=\"format\" src=\"https://user-images.githubusercontent.com/925351/39422105-54677d7e-4c6c-11e8-8cfa-3b7013d6cf64.png\"\u003e\n\n#### Format code\nUse the `Format code` option to run `gofmt` on your code. This is executed automatically when the `Run`, \n`Update`, `Share` or `Deploy` features are used.\n\n\u003ctable\u003e\u003c/table\u003e\n\n\u003cimg align=\"right\" width=\"150\" alt=\"update\" src=\"https://user-images.githubusercontent.com/925351/39422115-557afea2-4c6c-11e8-9af5-fb98f582ae6d.png\"\u003e\n\n#### Update\nIf you update a dependency, use the `Update` option, which does the equivalent of `go get -u` and refreshes \nthe changes in any import or dependency.   \n\n\u003ctable\u003e\u003c/table\u003e\n\n\u003cimg align=\"right\" width=\"150\" alt=\"share\" src=\"https://user-images.githubusercontent.com/925351/39422111-55268a34-4c6c-11e8-8ab6-bb6f718bcf5d.png\"\u003e\n\n#### Share\nTo share your project with others, use the `Share` option. Your project will be persisted to a json file \non `src.jsgo.io` and the page will update to a sharable URL.\n\n\u003ctable\u003e\u003c/table\u003e\n\n\u003cimg align=\"right\" width=\"150\" alt=\"deploy\" src=\"https://user-images.githubusercontent.com/925351/39422100-53ddecf8-4c6c-11e8-820c-4115472d4b8c.png\"\u003e\n\n#### Deploy\nTo deploy your code to [jsgo.io](https://jsgo.io), use the `Deploy` feature. A modal will be displayed with the \nlink to the page on `jsgo.io`, and the Loader JS on `pkg.jsgo.io`. \n\nUse the `jsgo.io` link for testing and toy projects. Remember you're sharing the `jsgo.io` domain with \neveryone else, so the browser environment should be considered toxic.\n\nThe Loader JS on `pkg.jsgo.io` can be used in production, and should be added to a script tag on your \nown website. See [github.com/dave/jsgo](https://github.com/dave/jsgo) for more information.\n\n\u003ctable\u003e\u003c/table\u003e\n\n\u003cimg align=\"right\" width=\"150\" alt=\"console\" src=\"https://user-images.githubusercontent.com/925351/39422096-53904c3c-4c6c-11e8-94f6-2c8f62c1f9a3.png\"\u003e\n\n#### Console\nWrites to `os.Stdout` are redirected to a playground console, which can be toggled using the `Show console`\noption. The console will automatically appear the first time it's written to.\n\n\u003ctable\u003e\u003c/table\u003e\n\n\u003cimg align=\"right\" width=\"150\" alt=\"minify\" src=\"https://user-images.githubusercontent.com/925351/39422107-54a89b56-4c6c-11e8-9eba-8d6c5492fef3.png\"\u003e\n\n#### Minify\nIn normal usage, all JS is minified. For debugging, this can be toggled with the `Minify JS` option.\n\n\u003ctable\u003e\u003c/table\u003e\n\n\u003cimg align=\"right\" width=\"150\" alt=\"tags\" src=\"https://user-images.githubusercontent.com/925351/39422112-554002fc-4c6c-11e8-8c2a-79b8e1f13045.png\"\u003e\n\n#### Build tags\nThe build tags used when compiling can be edited with the `Build tags...` option. The selected build \ntags are persisted when using the `Share` feature.\n\n\u003ctable\u003e\u003c/table\u003e\n\n\u003cimg align=\"right\" width=\"150\" alt=\"download\" src=\"https://user-images.githubusercontent.com/925351/39422103-54358530-4c6c-11e8-8dbb-23b109bab9f8.png\"\u003e\n\n#### Download\nThe `Download` option downloads the project. Single file projects are downloaded as a single file, while\nmulti-file projects download as a zip.\n\n\u003ctable\u003e\u003c/table\u003e\n\n\u003cimg align=\"right\" width=\"150\" alt=\"download\" src=\"https://user-images.githubusercontent.com/925351/39422494-e021814c-4c6d-11e8-8dd4-3ceb330d6d97.png\"\u003e\n\n#### Upload\nFiles can be uploaded to the project simply by drag+drop. Zip files generated by the `Download` feature\ncan be uploaded to restore a multi-file project.\n\n\u003ctable\u003e\u003c/table\u003e\n\n\u003cimg align=\"right\" width=\"150\" alt=\"files\" src=\"https://user-images.githubusercontent.com/925351/39422104-544e3f8a-4c6c-11e8-9953-002ae51db341.png\"\u003e\n\n#### File menu\nChange the selected file with the file menu.\n\n\u003ctable\u003e\u003c/table\u003e\n\n\u003cimg align=\"right\" width=\"150\" alt=\"add-file\" src=\"https://user-images.githubusercontent.com/925351/39422092-535a7d46-4c6c-11e8-9634-b9c36bb7b943.png\"\u003e\n\n#### Add file\nAdd a file to the current package with the `Add file` option. Only `.go`, `.md` and `.inc.js` files are\nsupported. If no extension is supplied, `.go` is added.\n\n\u003ctable\u003e\u003c/table\u003e\n\n\u003cimg align=\"right\" width=\"150\" alt=\"delete-file\" src=\"https://user-images.githubusercontent.com/925351/39422099-53c48e48-4c6c-11e8-838a-4f07a7db41bf.png\"\u003e\n\n#### Delete file\nDelete a file from the current package with the `Delete file` option.\n\n\u003ctable\u003e\u003c/table\u003e\n\n\u003cimg align=\"right\" width=\"150\" alt=\"package\" src=\"https://user-images.githubusercontent.com/925351/39422108-54cd5946-4c6c-11e8-9de8-21c9ff7a8bb3.png\"\u003e\n\n#### Package menu\nChange the selected package with the package menu.\n\n\u003ctable\u003e\u003c/table\u003e\n\n\u003cimg align=\"right\" width=\"150\" alt=\"add-package\" src=\"https://user-images.githubusercontent.com/925351/39422094-53742566-4c6c-11e8-86ad-9f2753c12c33.png\"\u003e\n\n#### Add package\nAdd an empty package with the `Add package` option.\n\n\u003ctable\u003e\u003c/table\u003e\n\n\u003cimg align=\"right\" width=\"150\" alt=\"load-package\" src=\"https://user-images.githubusercontent.com/925351/39422106-5480ef70-4c6c-11e8-97ce-cb169cf2219b.png\"\u003e\n\n#### Load package\nThe source for an import or dependency can be loaded with the `Load package` option. By default, only \nthe direct imports of your project are listed. Use the `Show all dependencies` option to show the entire\ndependency tree.\n\n\u003ctable\u003e\u003c/table\u003e\n\n\u003cimg align=\"right\" width=\"150\" alt=\"remove-package\" src=\"https://user-images.githubusercontent.com/925351/39422109-54e9836e-4c6c-11e8-913b-425945c194e0.png\"\u003e\n\n#### Remove package\nA package can be removed with the `Remove package` option.\n\n## Run locally?\n\nIf you'd like to run `play.jsgo.io` locally, take a look at [these instructions](https://github.com/dave/jsgo/blob/master/LOCAL.md).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdave%2Fplay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdave%2Fplay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdave%2Fplay/lists"}