{"id":36856646,"url":"https://github.com/zooyer/jsons","last_synced_at":"2026-01-12T14:44:31.114Z","repository":{"id":57549587,"uuid":"261934251","full_name":"zooyer/jsons","owner":"zooyer","description":"go json extension, support the database type.","archived":false,"fork":false,"pushed_at":"2022-05-24T10:43:44.000Z","size":78,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-06-21T15:36:25.339Z","etag":null,"topics":["go","gojson","gojsons","jsons"],"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/zooyer.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}},"created_at":"2020-05-07T02:52:20.000Z","updated_at":"2024-06-21T15:36:25.340Z","dependencies_parsed_at":"2022-08-27T00:40:43.039Z","dependency_job_id":null,"html_url":"https://github.com/zooyer/jsons","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/zooyer/jsons","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zooyer%2Fjsons","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zooyer%2Fjsons/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zooyer%2Fjsons/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zooyer%2Fjsons/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zooyer","download_url":"https://codeload.github.com/zooyer/jsons/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zooyer%2Fjsons/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28340403,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","gojson","gojsons","jsons"],"created_at":"2026-01-12T14:44:31.003Z","updated_at":"2026-01-12T14:44:31.088Z","avatar_url":"https://github.com/zooyer.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jsons- golang library\n\n![](https://travis-ci.org/boennemann/badges.svg?branch=master)  ![](https://img.shields.io/badge/license-MIT-blue.svg)  ![](https://img.shields.io/badge/godoc-reference-blue.svg)\n\nGolang like scripting languages using the json library.\n\n![](https://github.com/golang/go/blob/master/doc/gopher/fiveyears.jpg?raw=true)\n\n\n\n#### Download and Install\n\n```shell\ngo get github.com/zooyer/jsons\n```\n\n\n\n#### Features\n\n- type: Raw/Bool/Number/String/Array/Object/Value.\n- compatible with standard json library.\n- support orm model mapping.\n- chain calls.\n\n\n\n#### Example\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\n\t\"github.com/zooyer/jsons\"\n)\n\nfunc main() {\n\tvar json = `\n\t\t{\n\t\t\t\"a\": {\n\t\t\t\t\"b\": {\n\t\t\t\t\t\"c\": {\n\t\t\t\t\t\t\"name\": \"test\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t`\n\tvalue, err := jsons.Unmarshal([]byte(json))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tc := value.Get(\"a\", \"b\", \"c\")\n\tfmt.Println(\"c:\", c.JSONString())\n\n\tname := c.Get(\"name\")\n\tfmt.Println(\"name:\", name.String())\n\n\tc.Set(\"name\", \"abc\")\n\tfmt.Println(\"json:\", value.JSONString())\n\n\tjson = `\n\t\t[\n\t\t\t{\n\t\t\t\t\"name\": \"z1\",\n\t\t\t\t\"age\": 15\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"name\": \"z2\",\n\t\t\t\t\"age\": 13\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"name\": \"z3\",\n\t\t\t\t\"age\": 19\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"name\": \"z4\",\n\t\t\t\t\"age\": 14\n\t\t\t}\n\t\t]\n\t`\n\n\tvalue, err = jsons.Unmarshal([]byte(json))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tvalue.Sort(func(i, j int) bool {\n\t\treturn value.Int(i, \"age\") \u003c value.Int(j, \"age\")\n\t})\n\tfmt.Println(\"sort:\", value.JSONString())\n\tvalue.Reverse()\n\tfmt.Println(\"reverse:\", value.JSONString())\n}\n```\n\nouput:\n\n```shell\nc: {\"name\":\"test\"}\nname: test\njson: {\"a\":{\"b\":{\"c\":{\"name\":\"abc\"}}}}\nsort: [{\"age\":13,\"name\":\"z2\"},{\"age\":14,\"name\":\"z4\"},{\"age\":15,\"name\":\"z1\"},{\"age\":19,\"name\":\"z3\"}]\nreverse: [{\"age\":19,\"name\":\"z3\"},{\"age\":15,\"name\":\"z1\"},{\"age\":14,\"name\":\"z4\"},{\"age\":13,\"name\":\"z2\"}]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzooyer%2Fjsons","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzooyer%2Fjsons","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzooyer%2Fjsons/lists"}