{"id":16372587,"url":"https://github.com/hedhyw/jsoncjson","last_synced_at":"2025-03-23T03:32:30.327Z","repository":{"id":56337807,"uuid":"292895650","full_name":"hedhyw/jsoncjson","owner":"hedhyw","description":"JSONC (json with comments) to JSON translator for Golang.","archived":false,"fork":false,"pushed_at":"2024-02-01T06:46:59.000Z","size":31,"stargazers_count":11,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T17:05:52.273Z","etag":null,"topics":["go","golang","json","jsonc"],"latest_commit_sha":null,"homepage":"","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/hedhyw.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-04T16:27:18.000Z","updated_at":"2023-12-31T01:16:11.000Z","dependencies_parsed_at":"2024-06-21T16:41:24.155Z","dependency_job_id":"6ade0968-2d2c-4b77-97be-0d53de3b91c7","html_url":"https://github.com/hedhyw/jsoncjson","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hedhyw%2Fjsoncjson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hedhyw%2Fjsoncjson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hedhyw%2Fjsoncjson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hedhyw%2Fjsoncjson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hedhyw","download_url":"https://codeload.github.com/hedhyw/jsoncjson/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245052619,"owners_count":20553161,"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":["go","golang","json","jsonc"],"created_at":"2024-10-11T03:11:53.434Z","updated_at":"2025-03-23T03:32:30.050Z","avatar_url":"https://github.com/hedhyw.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSONcJSON\n\n![Version](https://img.shields.io/github/v/tag/hedhyw/jsoncjson)\n[![Go Report Card](https://goreportcard.com/badge/github.com/hedhyw/jsoncjson)](https://goreportcard.com/report/github.com/hedhyw/jsoncjson)\n[![Coverage Status](https://coveralls.io/repos/github/hedhyw/jsoncjson/badge.svg?branch=master)](https://coveralls.io/github/hedhyw/jsoncjson?branch=master)\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/hedhyw/jsoncjson)](https://pkg.go.dev/github.com/hedhyw/jsoncjson?tab=doc)\n\n\nThe library provides a JSONC (json with comments) to JSON streamer. It\nsupports multiline comments ( ` /* Comment */ `) and one-line comments\n( ` // Comment ` ). It processes chunks of 512 bytes in place.\n\nFor example, it translates JSON with comments:\n```jsonc\n{\n    /*\n        JSONcJSON\n        =^._.^= ∫\n    */\n    \"Hello\": \"world\" // In-line comments are also supported.\n}\n```\nto a valid JSON:\n```json\n{\n    \"Hello\": \"world\"\n}\n```\n\n## Installing:\n\n```sh\ngo get github.com/hedhyw/jsoncjson\n```\n\n## Usage example:\n\nMore [examples](./example_test.go).\n\n```go\n// Converting jsonc to json and decoding.\n\nconst in = `\n{\n    \"Hello\": \"world\"\n    /* Perhaps the truth depends on a walk around the lake. */\n}\n`\n\n// The reader can be anything.\n// For example: file, strings.NewReader(), bytes.NewReader(), ...\nvar r = jsoncjson.NewReader(strings.NewReader(in))\n\nvar data map[string]interface{}\n_, = json.NewDecoder(r).Decode(\u0026data)\n\nfmt.Printf(\"%+v\\n\", data) // map[Hello:world].\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhedhyw%2Fjsoncjson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhedhyw%2Fjsoncjson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhedhyw%2Fjsoncjson/lists"}