{"id":36953556,"url":"https://github.com/wasm-fmt/mago_fmt","last_synced_at":"2026-04-01T19:52:27.092Z","repository":{"id":328347961,"uuid":"1111741009","full_name":"wasm-fmt/mago_fmt","owner":"wasm-fmt","description":"A WASM based PHP Formatter","archived":false,"fork":false,"pushed_at":"2026-01-10T14:29:28.000Z","size":210,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-11T04:10:38.534Z","etag":null,"topics":["formatter","formatting","mago","php","wasm","web","webassembly"],"latest_commit_sha":null,"homepage":"","language":"Rust","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":"2025-12-07T14:52:02.000Z","updated_at":"2026-01-10T14:29:32.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/wasm-fmt/mago_fmt","commit_stats":null,"previous_names":["wasm-fmt/mago_fmt"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/wasm-fmt/mago_fmt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wasm-fmt%2Fmago_fmt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wasm-fmt%2Fmago_fmt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wasm-fmt%2Fmago_fmt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wasm-fmt%2Fmago_fmt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wasm-fmt","download_url":"https://codeload.github.com/wasm-fmt/mago_fmt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wasm-fmt%2Fmago_fmt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28385656,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T12:01:30.995Z","status":"ssl_error","status_checked_at":"2026-01-13T12:00:09.625Z","response_time":56,"last_error":"SSL_read: 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","mago","php","wasm","web","webassembly"],"created_at":"2026-01-13T12:46:28.634Z","updated_at":"2026-04-01T19:52:27.080Z","avatar_url":"https://github.com/wasm-fmt.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Test](https://github.com/wasm-fmt/mago_fmt/actions/workflows/test.yml/badge.svg)](https://github.com/wasm-fmt/mago_fmt/actions/workflows/test.yml)\n\n# Install\n\n[![npm](https://img.shields.io/npm/v/@wasm-fmt/mago_fmt?color=4F5D95)](https://www.npmjs.com/package/@wasm-fmt/mago_fmt)\n\n```bash\nnpm install @wasm-fmt/mago_fmt\n```\n\n[![jsr.io](https://jsr.io/badges/@fmt/mago-fmt?color=4F5D95)](https://jsr.io/@fmt/mago-fmt)\n\n```bash\nnpx jsr add @fmt/mago-fmt\n```\n\n# Usage\n\n## Node.js / Deno / Bun / Bundler\n\n```javascript\nimport { format } from \"@wasm-fmt/mago_fmt\";\n\nconst input = `\u003c?php\nfunction hello( \\$name ) {\n    echo \"Hello, \" . \\$name;\n}\n?\u003e`;\n\nconst formatted = format(input, \"main.php\", {\n\t\"use-tabs\": false,\n\t\"tab-width\": 4,\n\t\"print-width\": 120,\n});\nconsole.log(formatted);\n```\n\nWith specific PHP version:\n\n```javascript\nimport { format_with_version } from \"@wasm-fmt/mago_fmt\";\n\nconst input = `\u003c?php\nfunction hello( \\$name ) {\n    echo \"Hello, \" . \\$name;\n}\n?\u003e`;\n\nconst formatted = format_with_version(input, \"8.3\", \"main.php\", {\n\t\"use-tabs\": false,\n\t\"tab-width\": 4,\n\t\"print-width\": 120,\n});\nconsole.log(formatted);\n```\n\n## Web\n\nFor web environments, you need to initialize WASM module manually:\n\n```javascript\nimport init, { format } from \"@wasm-fmt/mago_fmt/web\";\n\nawait init();\n\nconst input = `\u003c?php\nfunction hello( \\$name ) {\n    echo \"Hello, \" . \\$name;\n}\n?\u003e`;\n\nconst formatted = format(input, \"main.php\", {\n\t\"use-tabs\": false,\n\t\"tab-width\": 4,\n\t\"print-width\": 120,\n});\nconsole.log(formatted);\n```\n\n### Vite\n\n```JavaScript\nimport init, { format } from \"@wasm-fmt/mago_fmt/vite\";\n\nawait init();\n// ...\n```\n\nOr use the `./bundler` entry with [vite-plugin-wasm](https://www.npmjs.com/package/vite-plugin-wasm)\n\n```javascript\nimport { format } from \"@wasm-fmt/mago_fmt/bundler\";\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# Credits\n\nThanks to:\n\n- The [Mago](https://github.com/carthage-software/mago) project created by [Carthage Software](https://github.com/carthage-software)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwasm-fmt%2Fmago_fmt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwasm-fmt%2Fmago_fmt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwasm-fmt%2Fmago_fmt/lists"}