{"id":19614624,"url":"https://github.com/activestate/json-ordered-tidy","last_synced_at":"2025-10-28T11:44:58.275Z","repository":{"id":66048031,"uuid":"148179862","full_name":"ActiveState/json-ordered-tidy","owner":"ActiveState","description":"A fancy JSON tidier that can arbitrarily order object keys","archived":false,"fork":false,"pushed_at":"2020-10-30T20:06:18.000Z","size":129,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-06-14T04:05:02.423Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ActiveState.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","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}},"created_at":"2018-09-10T15:46:48.000Z","updated_at":"2022-03-30T02:34:51.000Z","dependencies_parsed_at":"2023-03-27T17:58:37.985Z","dependency_job_id":null,"html_url":"https://github.com/ActiveState/json-ordered-tidy","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/ActiveState/json-ordered-tidy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActiveState%2Fjson-ordered-tidy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActiveState%2Fjson-ordered-tidy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActiveState%2Fjson-ordered-tidy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActiveState%2Fjson-ordered-tidy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ActiveState","download_url":"https://codeload.github.com/ActiveState/json-ordered-tidy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActiveState%2Fjson-ordered-tidy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259756874,"owners_count":22906678,"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":[],"created_at":"2024-11-11T10:53:08.561Z","updated_at":"2025-10-28T11:44:58.168Z","avatar_url":"https://github.com/ActiveState.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## `json-ordered-tidy ... ./file.json ./dir`\n\nThis command tidies all the files it finds, preserving the existing map key\norder. If given a directory it looks for files matching the given -ext\nvalue.\n\nThis tidier is capable of sorting object keys in arbitrary orders, as well\nas optional sorting the contents of arrays. You can configure this using a\nJSON-based config file.\n\nThe config file should be a JSON object. It can contain three keys,\n\"indent\", \"keyOrder\" and \"arraySort\". You can specify just one key as\nwell. Note that specifying \"indent\" in the config file will override any\ncommand line.\n\nThe \"keyOrder\" key should in turn contain an object where the keys are JSON\nPath expressions and the values are arrays of key names. The JSON Path\nsupport is fairly limited.\n\nAll expressions must start with \"$\". You can use the following types of\nexpressions:\n\n* \\.\\.  - This a recursive descent operator that matches any number of nodes of any type.\n* .*  - This matches a single node of any type.\n* [*] - This matches every element of an array.\n\nWhen an object in the JSON file matches a path, it's keys are sorted as\nspecified. Note that if an object matches multiple JSON Path expressions the\nresults are unpredictable.\n\nHere is an example config for JSON Schemas:\n\n```json\n{\n    \"indent\": \"    \",\n    \"keyOrder\": {\n        \"$\": [\n            \"$schema\",\n            \"$id\",\n            \"title\",\n            \"description\",\n            \"type\",\n            \"additionalProperties\",\n            \"properties\",\n            \"required\"\n        ],\n        \"$..properties.*\": [\n            \"$id\",\n            \"title\",\n            \"description\",\n            \"type\",\n            \"x-nullable\",\n            \"enum\",\n            \"format\",\n            \"additionalProperties\",\n            \"properties\",\n            \"required\",\n            \"examples\"\n        ]\n    },\n    \"arraySort\": [\n        \"$..properties..enum\",\n        \"$..required\"\n    ]\n}\n```\n\nThe order of the key names in the arrays tell the tidier what order the keys\nshould be sorted in. Any keys not explicitly listed will be sorted _after_\nthe listed keys in case-insensitive alphanumeric order.\n\nIf you want to sort all of an object's keys in case-insensitive alphanumeric\norder you can provide an empty array for the key order.\n\nThe \"arraySort\" key is an array of JSON Path expressions. Any array matching\nthe expression will be sorted numerically or as strings, as\nappropriate. Strings are sorted in case-insensitive alphanumeric order.\n\n* -check - Run in check mode. In this mode we exit 0 if all files are already tidy, otherwise the exit status is 1.\n* -config - A config file containing key ordering and array sorting specifications.\n* -debug - Enable debugging output.\n* -ext - The file extension to match against. Only files with this extension will be tidied. (default \".json\")\n* -help - Show usage information.\n* -indent - The string with which to indent JSON. Defaults to 4 spaces.\n* -stdout - Instead of tidying file in place, output content to stdout. When this is flag is set the file contents will be printed even when it is already tidy. This flag is irrelevant when running in -check mode.\n* -verbose - Be more verbose with output.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factivestate%2Fjson-ordered-tidy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Factivestate%2Fjson-ordered-tidy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factivestate%2Fjson-ordered-tidy/lists"}