{"id":19742196,"url":"https://github.com/wasm-fmt/ruff_fmt","last_synced_at":"2026-04-12T17:01:12.445Z","repository":{"id":187157475,"uuid":"676142452","full_name":"wasm-fmt/ruff_fmt","owner":"wasm-fmt","description":"A WASM Based Python Formatter","archived":false,"fork":false,"pushed_at":"2026-03-22T12:47:08.000Z","size":844,"stargazers_count":14,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-23T04:26:00.698Z","etag":null,"topics":["dprint","formatter","formatting","python","ruff","wasm","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":"2023-08-08T14:21:58.000Z","updated_at":"2026-03-22T12:47:12.000Z","dependencies_parsed_at":"2023-08-09T07:37:01.105Z","dependency_job_id":"8b55150b-6fe2-4a2d-9718-e606ae7fff41","html_url":"https://github.com/wasm-fmt/ruff_fmt","commit_stats":null,"previous_names":["wasm-fmt/ruff_fmt"],"tags_count":48,"template":false,"template_full_name":null,"purl":"pkg:github/wasm-fmt/ruff_fmt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wasm-fmt%2Fruff_fmt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wasm-fmt%2Fruff_fmt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wasm-fmt%2Fruff_fmt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wasm-fmt%2Fruff_fmt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wasm-fmt","download_url":"https://codeload.github.com/wasm-fmt/ruff_fmt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wasm-fmt%2Fruff_fmt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31439442,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T13:13:19.330Z","status":"ssl_error","status_checked_at":"2026-04-05T13:13:17.778Z","response_time":75,"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":["dprint","formatter","formatting","python","ruff","wasm","webassembly"],"created_at":"2024-11-12T01:29:32.505Z","updated_at":"2026-04-05T15:01:54.444Z","avatar_url":"https://github.com/wasm-fmt.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Test](https://github.com/wasm-fmt/ruff_fmt/actions/workflows/test.yml/badge.svg)](https://github.com/wasm-fmt/ruff_fmt/actions/workflows/test.yml)\n\n# Install\n\n[![npm](https://img.shields.io/npm/v/@wasm-fmt/ruff_fmt?color=3572A5)](https://www.npmjs.com/package/@wasm-fmt/ruff_fmt)\n\n```bash\nnpm install @wasm-fmt/ruff_fmt\n```\n\n[![jsr.io](https://jsr.io/badges/@fmt/ruff-fmt?color=3572A5)](https://jsr.io/@fmt/ruff-fmt)\n\n```bash\nnpx jsr add @fmt/ruff-fmt\n```\n\n# Usage\n\n## Node.js / Deno / Bun / Bundler\n\n```javascript\nimport { format } from \"@wasm-fmt/ruff_fmt\";\n\nconst input = `x = {  'a':37,'b':42,\n\n'c':927}\n\ny = 'hello ''world'\nz = 'hello '+'world'\na = 'hello {}'.format('world')\nclass foo  (     object  ):\n  def f    (self   ):\n    return       37*-+2\n  def g(self, x,y=42):\n      return y\ndef f  (   a ) :\n  return      37+-+a[42-x :  y**3]`;\n\nconst formatted = format(input, \"main.py\", {\n\tindent_style: \"space\",\n\tindent_width: 4,\n\tline_width: 88,\n\tquote_style: \"double\",\n\tmagic_trailing_comma: \"respect\",\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/ruff_fmt/web\";\n\nawait init();\n\nconst input = `x = {  'a':37,'b':42,\n\n'c':927}`;\n\nconst formatted = format(input, \"main.py\");\nconsole.log(formatted);\n```\n\n### Vite\n\n```JavaScript\nimport init, { format } from \"@wasm-fmt/ruff_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/ruff_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# dprint plugin\n\n\u003e [!NOTE]\n\u003e dpint plugin is deprecated, please use https://dprint.dev/plugins/ruff instead.\n\n# How does it work?\n\n[Ruff] is an extremely fast Python linter, written in Rust.\n\nThis package is a WebAssembly build of Ruff formatter, with a JavaScript wrapper.\n\n[Ruff]: https://github.com/astral-sh/ruff\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwasm-fmt%2Fruff_fmt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwasm-fmt%2Fruff_fmt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwasm-fmt%2Fruff_fmt/lists"}