{"id":13601017,"url":"https://github.com/muhammadmuzzammil1998/jsonc","last_synced_at":"2025-05-16T06:06:48.187Z","repository":{"id":42974757,"uuid":"205694535","full_name":"muhammadmuzzammil1998/jsonc","owner":"muhammadmuzzammil1998","description":"JSON with comments for Go!","archived":false,"fork":false,"pushed_at":"2024-02-09T21:02:46.000Z","size":1052,"stargazers_count":201,"open_issues_count":4,"forks_count":21,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-08T16:03:34.251Z","etag":null,"topics":["golang","gopkg","json","jsonc"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/muhammadmuzzammil1998.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","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":"2019-09-01T15:18:25.000Z","updated_at":"2025-03-09T13:12:35.000Z","dependencies_parsed_at":"2024-06-23T18:47:37.522Z","dependency_job_id":null,"html_url":"https://github.com/muhammadmuzzammil1998/jsonc","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammadmuzzammil1998%2Fjsonc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammadmuzzammil1998%2Fjsonc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammadmuzzammil1998%2Fjsonc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammadmuzzammil1998%2Fjsonc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/muhammadmuzzammil1998","download_url":"https://codeload.github.com/muhammadmuzzammil1998/jsonc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254478190,"owners_count":22077676,"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":["golang","gopkg","json","jsonc"],"created_at":"2024-08-01T18:00:52.714Z","updated_at":"2025-05-16T06:06:43.176Z","avatar_url":"https://github.com/muhammadmuzzammil1998.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"#\n\n![jsonc](.github/images/jsonc.png)\n\n\u003cp align=\"center\"\u003e\n  \u003ci\u003eJSON with comments for Go!\u003c/i\u003e \u003cbr\u003e\n  \u003ci\u003e\u003ca href=\"https://github.com/muhammadmuzzammil1998/jsonc/actions/workflows/go.yml\" target=\"_blank\"\u003e\u003cimg src=\"https://github.com/muhammadmuzzammil1998/jsonc/actions/workflows/go.yml/badge.svg\" alt=\"GitHub Actions\"\u003e\u003c/a\u003e\u003c/i\u003e\n\u003c/p\u003e\n\nJSONC is a superset of JSON which supports comments. JSON formatted files are readable to humans but the lack of comments decreases readability. With JSONC, you can use block (`/* */`) and single line (`//` of `#`) comments to describe the functionality. Microsoft VS Code also uses this format in their configuration files like `settings.json`, `keybindings.json`, `launch.json`, etc.\n\n![jsonc](.github/images/carbon.png)\n\n## What this package offers\n\n**JSONC for Go** offers ability to convert and unmarshal JSONC to pure JSON. It also provides functionality to read JSONC file from disk and return JSONC and corresponding JSON encoding to operate on. However, it only provides a one way conversion. That is, you can not generate JSONC from JSON. Read [documentation](.github/DOCUMENTATION.md) for detailed examples.\n\n## Usage\n\n### `go get` it\n\nRun `go get` command to install the package.\n\n```sh\n$ go get muzzammil.xyz/jsonc\n```\n\n### Import jsonc\n\nImport `muzzammil.xyz/jsonc` to your source file.\n\n```go\npackage main\n\nimport (\n  \"fmt\"\n\n  \"muzzammil.xyz/jsonc\"\n)\n```\n\n### Test it\n\nNow test it!\n\n```go\nfunc main() {\n  j := []byte(`{\"foo\": /*comment*/ \"bar\"}`)\n  jc := jsonc.ToJSON(j) // Calling jsonc.ToJSON() to convert JSONC to JSON\n  if jsonc.Valid(jc) {\n    fmt.Println(string(jc))\n  } else {\n    fmt.Println(\"Invalid JSONC\")\n  }\n}\n```\n\n```sh\n$ go run app.go\n{\"foo\":\"bar\"}\n```\n\n## Contributions\n\nContributions are welcome but kindly follow the Code of Conduct and guidelines. Please don't make Pull Requests for typographical errors, grammatical mistakes, \"sane way\" of doing it, etc. Open an issue for it. Thanks!\n\n### Contributors\n\n\u003ca href=\"https://github.com/muhammadmuzzammil1998/jsonc/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=muhammadmuzzammil1998/jsonc\" /\u003e\n\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuhammadmuzzammil1998%2Fjsonc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuhammadmuzzammil1998%2Fjsonc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuhammadmuzzammil1998%2Fjsonc/lists"}