{"id":18078086,"url":"https://github.com/wasm-fmt/gofmt","last_synced_at":"2026-01-16T23:25:45.003Z","repository":{"id":186468204,"uuid":"674462332","full_name":"wasm-fmt/gofmt","owner":"wasm-fmt","description":"A WASM Based Golang Formatter","archived":false,"fork":false,"pushed_at":"2026-01-11T05:28:35.000Z","size":454,"stargazers_count":11,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-11T12:42:42.719Z","etag":null,"topics":["formatter","formatting","go","gofmt","golang","wasm","webassembly"],"latest_commit_sha":null,"homepage":"","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/wasm-fmt.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-08-04T02:35:18.000Z","updated_at":"2026-01-08T11:54:00.000Z","dependencies_parsed_at":"2023-10-14T23:08:16.450Z","dependency_job_id":"ee3e31f2-dc78-4efe-83eb-37a7c6bed1c6","html_url":"https://github.com/wasm-fmt/gofmt","commit_stats":null,"previous_names":["wasm-fmt/gofmt"],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/wasm-fmt/gofmt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wasm-fmt%2Fgofmt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wasm-fmt%2Fgofmt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wasm-fmt%2Fgofmt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wasm-fmt%2Fgofmt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wasm-fmt","download_url":"https://codeload.github.com/wasm-fmt/gofmt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wasm-fmt%2Fgofmt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28487586,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T22:54:02.790Z","status":"ssl_error","status_checked_at":"2026-01-16T22:50:10.344Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["formatter","formatting","go","gofmt","golang","wasm","webassembly"],"created_at":"2024-10-31T12:12:04.758Z","updated_at":"2026-01-16T23:25:44.991Z","avatar_url":"https://github.com/wasm-fmt.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Test](https://github.com/wasm-fmt/gofmt/actions/workflows/test.yml/badge.svg)](https://github.com/wasm-fmt/gofmt/actions/workflows/test.yml)\n\n# Install\n\n[![npm](https://img.shields.io/npm/v/@wasm-fmt/gofmt?color=00ADD8)](https://www.npmjs.com/package/@wasm-fmt/gofmt)\n\n```bash\nnpm install @wasm-fmt/gofmt\n```\n\n[![jsr.io](https://jsr.io/badges/@fmt/gofmt?color=00ADD8)](https://jsr.io/@fmt/gofmt)\n\n```bash\nnpx jsr add @fmt/gofmt\n```\n\n# Usage\n\n## Node.js / Deno / Bun / Bundler\n\n```javascript\nimport { format } from \"@wasm-fmt/gofmt\";\n\nconst source = `\npackage main\nimport \"fmt\"\nfunc main(){fmt.Println(\"Hello, 世界\")\n}\n`;\n\nconst formatted = format(source);\nconsole.log(formatted);\n```\n\n## Node.js \u003c 22.19\n\n```JavaScript\nimport { format } from \"@wasm-fmt/gofmt/node\";\n```\n\n## Web\n\nFor web environments, you need to initialize WASM module manually:\n\n```javascript\nimport init, { format } from \"@wasm-fmt/gofmt/web\";\n\nawait init();\n\nconst source = `\npackage main\nimport \"fmt\"\nfunc main(){fmt.Println(\"Hello, 世界\")\n}\n`;\n\nconst formatted = format(source);\nconsole.log(formatted);\n```\n\n### Vite\n\n```JavaScript\nimport init, { format } from \"@wasm-fmt/gofmt/vite\";\n\nawait init();\n// ...\n```\n\n## Entry Points\n\n- `.` - Auto-detects environment (Node.js uses node, Webpack uses bundler, default is ESM)\n- `./node` - Node.js environment (no init required)\n- `./esm` - ESM environments like Deno (no init required)\n- `./bundler` - Bundlers like Webpack (no init required)\n- `./web` - Web browsers (requires manual init)\n- `./vite` - Vite bundler (requires manual init)\n\n# Build from source\n\n```bash\n# 1. install Go https://go.dev/doc/install\n\n# 2. install TinyGo https://tinygo.org/getting-started/install/\n\n# 3. clone this repo\ngit clone https://github.com/wasm-fmt/gofmt.git\n\n# 4. build\nnpm run build\n\n# 6. test\nnpm run test:node\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwasm-fmt%2Fgofmt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwasm-fmt%2Fgofmt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwasm-fmt%2Fgofmt/lists"}