{"id":21827772,"url":"https://github.com/sane-fmt/deno","last_synced_at":"2026-05-10T09:56:13.660Z","repository":{"id":43057672,"uuid":"353295241","full_name":"sane-fmt/deno","owner":"sane-fmt","description":"Opinionated code formatter for TypeScript and JavaScript","archived":false,"fork":false,"pushed_at":"2024-02-25T09:10:43.000Z","size":19090,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-26T08:27:54.628Z","etag":null,"topics":["deno","formatter","javascript","opinionated","sane-fmt","typescript","wasi","webassembly"],"latest_commit_sha":null,"homepage":"https://sane-fmt.github.io/deno/","language":"TypeScript","has_issues":false,"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/sane-fmt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","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},"funding":{"github":null,"patreon":"khai96_","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2021-03-31T09:11:35.000Z","updated_at":"2021-12-20T17:08:17.000Z","dependencies_parsed_at":"2024-02-25T08:43:47.134Z","dependency_job_id":null,"html_url":"https://github.com/sane-fmt/deno","commit_stats":{"total_commits":180,"total_committers":3,"mean_commits":60.0,"dds":0.05555555555555558,"last_synced_commit":"9f8f56c1a484da8b598ce65f1cc67f55a0980281"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sane-fmt%2Fdeno","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sane-fmt%2Fdeno/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sane-fmt%2Fdeno/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sane-fmt%2Fdeno/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sane-fmt","download_url":"https://codeload.github.com/sane-fmt/deno/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244796786,"owners_count":20511750,"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":["deno","formatter","javascript","opinionated","sane-fmt","typescript","wasi","webassembly"],"created_at":"2024-11-27T18:14:10.557Z","updated_at":"2026-05-10T09:56:08.611Z","avatar_url":"https://github.com/sane-fmt.png","language":"TypeScript","funding_links":["https://patreon.com/khai96_"],"categories":[],"sub_categories":[],"readme":"# sane-fmt\n\nOpinionated code formatter for TypeScript and JavaScript.\n\n* Main Repo: [sane-fmt/sane-fmt](https://github.com/sane-fmt/sane-fmt)\n  * [Issues](https://github.com/sane-fmt/sane-fmt/issues)\n* Version: 0.18.1\n  - [GitHub Release](https://github.com/sane-fmt/sane-fmt/releases/tag/0.18.1)\n  - [Deno Page](https://deno.land/x/sane_fmt@0.18.1)\n\n## Usage in Deno\n\n* `Deno.version.deno`: 1.40.4\n* `Deno.version.v8`: 12.1.285.6\n* `Deno.version.typescript`: 5.3.3\n\n### Command Line Interface\n\n#### [Main CLI](https://deno.land/x/sane_fmt@0.18.1/main.js)\n\n\u003e ⚠ WARNING: Due to technical limitations, the main CLI currently does not support Windows. You may download the native version from [the GitHub Release page of sane-fmt](https://github.com/sane-fmt/sane-fmt/releases). [The stdio CLI](#stdio-cli) is still supported.\n\n**Installation:**\n\n```sh\ndeno install \\\n  --allow-read \\\n  --allow-write \\\n  --allow-env \\\n  --name=sane-fmt \\\n  https://deno.land/x/sane_fmt@0.18.1/main.js\n```\n\n**Environment Variables:**\n\n* `SANE_FMT_DENO_PREOPENS`: A list of preopened directories. Its delimiter is colon (`:`) on Linux/Unix and semicolon (`;`) in Windows.\n\n**Usage:**\n\n```\nOpinionated code formatter for TypeScript and JavaScript\n\nUsage: sane-fmt [OPTIONS] [FILES]...\n\nArguments:\n  [FILES]...\n          Files to process\n\n          If none are provided, a default set of files will be assumed\n\nOptions:\n      --stdio\n          Reads unformatted code from standard input, prints formatted code to standard output, then exits\n\n  -w, --write\n          Whether to write or check\n\n      --details \u003cDETAILS\u003e\n          File diff detail\n\n          [default: name]\n          [possible values: count, name, diff]\n\n      --hide-passed\n          Do not log passed filenames\n\n      --color \u003cCOLOR\u003e\n          When to use terminal color\n\n          [default: auto]\n          [possible values: auto, never, always]\n\n      --log-format \u003cLOG_FORMAT\u003e\n          Format of log messages\n\n          [default: human]\n          [possible values: human, github-actions]\n\n  -I, --include \u003cINCLUDE\u003e\n          Files whose contents contain paths to target files (`-` means stdin, other strings mean text file)\n\n  -h, --help\n          Print help (see a summary with '-h')\n\n  -V, --version\n          Print version\n\n```\n\n#### [Stdio CLI](https://deno.land/x/sane_fmt@0.18.1/stdio.js)\n\nUnlike the feature-packed [main CLI](#main-cli), the stdio CLI only function is to read TypeScript code from stdin and print formatted code to stdout.\n\n**Installation:**\n\n```sh\ndeno install --name=sane-fmt-stdio https://deno.land/x/sane_fmt@0.18.1/stdio.js\n```\n\n**Usage Example:**\n\n```sh\necho 'const message=\"hello world\";' | sane-fmt-stdio\n```\n\n_Expected Output:_\n\n```txt\nconst message = 'hello world'\n```\n\n### Programming Interface\n\n* [/x/sane_fmt](https://deno.land/x/sane_fmt@0.18.1/index.ts)\n* [API Reference](https://doc.deno.land/https/deno.land//x/sane_fmt@0.18.1/index.ts)\n\n#### Example: Format a file\n\n```javascript\nimport Context from 'https://deno.land/std@0.92.0/wasi/snapshot_preview1.ts'\nimport { u8v } from 'https://deno.land/x/sane_fmt@0.18.1/index.ts'\nconst context = new Context({\n  args: ['sane-fmt', 'example-directory/example-file.ts'],\n  stdin: Deno.stdin.rid,\n  stdout: Deno.stdout.rid,\n  stderr: Deno.stderr.rid,\n  preopens: {\n    'example-directory': 'example-directory',\n  },\n})\nconst module = await WebAssembly.compile(u8v)\nconst instance = await WebAssembly.instantiate(module, {\n  wasi_snapshot_preview1: context.exports,\n})\nconst status = context.start(instance)\nif (status) {\n  throw new Error(`Program exits with code ${status}`)\n}\n```\n\n#### Example: Read unformatted input and print formatted output\n\n```javascript\nimport Context from 'https://deno.land/std@0.92.0/wasi/snapshot_preview1.ts'\nimport { u8v } from 'https://deno.land/x/sane_fmt@0.18.1/index.ts'\nconst context = new Context({\n  args: ['sane-fmt', '--stdio'],\n  stdin: Deno.stdin.rid,\n  stdout: Deno.stdout.rid,\n  stderr: Deno.stderr.rid,\n})\nconst module = await WebAssembly.compile(u8v)\nconst instance = await WebAssembly.instantiate(module, {\n  wasi_snapshot_preview1: context.exports,\n})\nconst status = context.start(instance)\nif (status) {\n  throw new Error(`Program exits with code ${status}`)\n}\n```\n\n## License\n\n[MIT](https://git.io/JY6mh) © [Hoàng Văn Khải](https://ksxgithub.github.io/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsane-fmt%2Fdeno","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsane-fmt%2Fdeno","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsane-fmt%2Fdeno/lists"}