{"id":18910339,"url":"https://github.com/luckyscript/json_formater","last_synced_at":"2026-03-08T00:30:22.979Z","repository":{"id":40729646,"uuid":"234522821","full_name":"luckyscript/json_formater","owner":"luckyscript","description":"format irregular json","archived":false,"fork":false,"pushed_at":"2022-12-05T04:38:26.000Z","size":1178,"stargazers_count":1,"open_issues_count":12,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-02T08:18:07.304Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/luckyscript.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-17T10:08:22.000Z","updated_at":"2020-10-12T09:54:40.000Z","dependencies_parsed_at":"2023-01-24T03:30:16.226Z","dependency_job_id":null,"html_url":"https://github.com/luckyscript/json_formater","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luckyscript%2Fjson_formater","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luckyscript%2Fjson_formater/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luckyscript%2Fjson_formater/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luckyscript%2Fjson_formater/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luckyscript","download_url":"https://codeload.github.com/luckyscript/json_formater/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239900401,"owners_count":19715549,"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-08T09:42:06.259Z","updated_at":"2026-03-08T00:30:22.938Z","avatar_url":"https://github.com/luckyscript.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# json formater\nWe always have a headache when we want to make an Object to a json string;\n\nThink this case:\nwhen we want to copy our javascript object`{'a': 1}` to some mock platform, it always shows JSON error, because it's not a correct json.\n\nso we use JSON.stringify and then copy? However, it always produce some escape and other token.\n\nUse this package to solve the problem!just:\n```\nimport formater from 'json-formater';\nformater.format('{a: \"b\"}')\n```\n\n\n## parser\n\nJSON has 2 types\n* object\n* array\n\n### Objectlike JSON\n![](https://www.json.org/img/object.png)\n\n### Arraylike JSON\n![](https://www.json.org/img/array.png)\n\nIn addition, JSON has 6 value types，include above 2 types and 4 types following.\n\n* number\n* string\n* boolean\n* null\n\n![](https://www.json.org/img/value.png)\n\n### string\n![](https://www.json.org/img/string.png)\n\n### number\n![](https://www.json.org/img/number.png)\n\n### boolean \u0026 null\nboolean \u0026 null has literal value: true, false, null\n\n### whitespace\nWhitespace can be inserted between any pair of tokens. Excepting a few encoding details, that completely describes the language.\n![](https://www.json.org/img/whitespace.png)\n\n## generator\ntransform AST to JSON code","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluckyscript%2Fjson_formater","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluckyscript%2Fjson_formater","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluckyscript%2Fjson_formater/lists"}