{"id":13595837,"url":"https://github.com/rhysd/fixjson","last_synced_at":"2025-04-09T10:09:06.904Z","repository":{"id":28325735,"uuid":"117089970","full_name":"rhysd/fixjson","owner":"rhysd","description":"JSON Fixer for Humans using (relaxed) JSON5","archived":false,"fork":false,"pushed_at":"2023-10-17T01:05:04.000Z","size":204,"stargazers_count":133,"open_issues_count":8,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-02T04:59:56.598Z","etag":null,"topics":["fixer","formatter","json"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/fixjson","language":"TypeScript","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/rhysd.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}},"created_at":"2018-01-11T11:13:56.000Z","updated_at":"2025-03-13T06:02:35.000Z","dependencies_parsed_at":"2024-01-14T15:21:30.899Z","dependency_job_id":"86a00181-d355-43a2-8df6-f8b3cee6958e","html_url":"https://github.com/rhysd/fixjson","commit_stats":{"total_commits":72,"total_committers":2,"mean_commits":36.0,"dds":0.09722222222222221,"last_synced_commit":"c49f27a0268fca69021fa8aafc9bbef9960f82e9"},"previous_names":["rhysd/jsonfiver"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhysd%2Ffixjson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhysd%2Ffixjson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhysd%2Ffixjson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhysd%2Ffixjson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rhysd","download_url":"https://codeload.github.com/rhysd/fixjson/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248018061,"owners_count":21034048,"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":["fixer","formatter","json"],"created_at":"2024-08-01T16:01:58.886Z","updated_at":"2025-04-09T10:09:06.879Z","avatar_url":"https://github.com/rhysd.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"JSON fixer for Humans\n=====================\n[![npm version][]][fixjson]\n[![ci-badge][]][ci]\n\n[fixjson][] is a JSON file fixer/formatter for humans using (relaxed) JSON5.\n\nfixjson provides:\n\n- Pretty-printing JSON5 input\n  - ES5 syntax is available to write up JSON\n- Fixes various failures while humans writing JSON\n  - Fixes trailing commas objects or arrays\n  - Fixes missing commas for elements of objects or arrays\n  - Adds quotes to keys in objects\n  - Newlines in strings\n  - Hex numbers\n  - Fixes single quotes to double quotes\n\nfixjson reads an input in [relaxed JSON5][forked json5] format and outputs it in JSON format. Indent\nwidth is automatically detected.\n\nThis CLI tool aims to be used with editor extensions.\n\n- [vim-fixjson][] (dedicated Vim plugin)\n- [ALE][] (Vim plugin)\n- [neoformat][] (Vim plugin)\n- [vim-autoformat][] (Vim plugin)\n\n## Screenshots of Fixes\n\nWhen moving a line to another line, you no longer need to care about a trailing comma:\n\n![modify keys](https://github.com/rhysd/ss/raw/master/fixjson/modifykeys.gif)\n\nAnd you also don't need to care about a trailing comma of a previous line when adding a new element\nto an object or an array:\n\n![add key](https://github.com/rhysd/ss/raw/master/fixjson/addkey.gif)\n\nWhen adding a new key-value to an object, quotes of the key are fixed. And single quotes for strings\nare also fixed to double quotes:\n\n![key quotes](https://github.com/rhysd/ss/raw/master/fixjson/keyquotes.gif)\n\nJSON string does not allow multi-line string. `\\n` is required to embed multi-line string to JSON.\nfixjson automatically fixes newlines in strings. This is useful when copy\u0026paste some string to JSON\nfile:\n\n![newlines in string](https://github.com/rhysd/ss/raw/master/fixjson/newlines.gif)\n\nJSON only accepts decimal digits for numbers. fixjson automatically converts `0x` hex numbers to\ndecimal numbers. You no longer need to convert hex numbers manually:\n\n![hex numbebr](https://github.com/rhysd/ss/raw/master/fixjson/number.gif)\n\nAnd of course it pretty-prints the JSON code, with automatic indent detection:\n\n![pretty printing](https://github.com/rhysd/ss/raw/master/fixjson/prettyprint.gif)\n\n## Installation\n\n```sh\n$ npm install -g fixjson\n```\n\nIt installs `fixjson` command globally.\n\n## Usage\n\n```sh\nfixjson [--write|--indent|--minify|--stdin-filename] [paths...]\n```\n\nIf paths are given, glob such as `dir/**/*.json` is available. If the path is a directory, it formats\nall JSON files in the directory. If no path is given, it reads from STDIN.\n\nIf `--write` (or `-w`) option is provided, it overwrites files.\n\nIf `--indent {num}` (or `-i {num}`) is not provided, it detects indent spaces.\n\nPlease see `fixjson --help` for more details.\n\n## License\n\nDistributed under the MIT License. Please see [LICENSE](LICENSE).\n\n[fixjson]: https://www.npmjs.com/package/fixjson\n[vim-fixjson]: https://github.com/rhysd/vim-fixjson\n[forked json5]: https://github.com/rhysd/json5\n[npm version]: https://badge.fury.io/js/fixjson.svg\n[ci-badge]: https://github.com/rhysd/fixjson/workflows/CI/badge.svg?branch=ga\u0026event=push\n[ci]: https://github.com/rhysd/fixjson/actions?query=workflow%3ACI\n[neoformat]: https://github.com/sbdchd/neoformat\n[vim-autoformat]: https://github.com/Chiel92/vim-autoformat\n[ALE]: https://github.com/w0rp/ale\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhysd%2Ffixjson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frhysd%2Ffixjson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhysd%2Ffixjson/lists"}