{"id":37142214,"url":"https://github.com/mohammadmohebi/mmj","last_synced_at":"2026-01-14T16:41:40.363Z","repository":{"id":57530425,"uuid":"113998459","full_name":"mohammadmohebi/mmj","owner":"mohammadmohebi","description":"JSON Creator library","archived":false,"fork":false,"pushed_at":"2018-11-13T21:48:06.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-20T04:19:32.880Z","etag":null,"topics":["go","golang","json"],"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/mohammadmohebi.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":"2017-12-12T14:12:21.000Z","updated_at":"2020-09-29T15:49:10.000Z","dependencies_parsed_at":"2022-09-10T11:01:58.553Z","dependency_job_id":null,"html_url":"https://github.com/mohammadmohebi/mmj","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mohammadmohebi/mmj","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohammadmohebi%2Fmmj","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohammadmohebi%2Fmmj/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohammadmohebi%2Fmmj/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohammadmohebi%2Fmmj/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mohammadmohebi","download_url":"https://codeload.github.com/mohammadmohebi/mmj/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohammadmohebi%2Fmmj/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28426169,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T16:38:47.836Z","status":"ssl_error","status_checked_at":"2026-01-14T16:34:59.695Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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","golang","json"],"created_at":"2026-01-14T16:41:39.841Z","updated_at":"2026-01-14T16:41:40.359Z","avatar_url":"https://github.com/mohammadmohebi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mmj\nJSON Creator library. This library helps to easly create JSON dynamicaly.\n\n## To install\n```bash\ngo get github.com/mohammadmohebi/mmj\n```\n\n## Create an object\n```go\nimport \"github.com/mohammadmohebi/mmj\"\n\n...\nobj := mmj.NewObj()\n\nobj.SetP(\"Honda\", \"car.brand\")\nobj.SetP(\"Civic\", \"car.model\")\nobj.SetP(2017, \"car.year\")\n\nobj.Set(12000, \"car\", \"price\")\nfmt.Println(obj.String())\n```\nResult\n```json\n{\n  \"car\": {\n    \"brand\":\"Honda\",\n    \"model\":\"Civic\",\n    \"year\":2017,\n    \"price\":12000\n  }\n}\n```\n\n## Create an array\n```go\nimport \"github.com/mohammadmohebi/mmj\"\n\n...\narr := mmj.NewArray()\narr.Append(\"Honda\")\narr.Append(\"Toyota\")\narr.Append(\"Mazda\")\nfmt.Println(arr.String())\n```\nResult\n```json\n[\n  \"Honda\",\n  \"Toyota\",\n  \"Mazda\"\n]\n```\n\n## Insert object inside an object\n```go\nimport \"github.com/mohammadmohebi/mmj\"\n\n...\narticles := mmj.NewObj()\n\nobj := mmj.NewObj()\nobj.SetP(\"vegetable\", \"type\")\nobj.SetP(\"radish\", \"name\")\nobj.SetP(2.5, \"price\")\n\narticles.SetP(obj, \"basket.article\")\n\nfmt.Println(articles.String())\n\n```\nResult\n```json\n{\n  \"basket\": {\n    \"article\": {\n      \"type\":\"vegetable\",\n      \"name\":\"radish\",\n      \"price\": 2.5\n    }\n  }\n}\n```\n## Insert objects inside an array\n```go\nimport \"github.com/mohammadmohebi/mmj\"\n\n...\narticles := mmj.NewArray()\n\nobj := mmj.NewObj()\nobj.SetP(\"vegetable\", \"type\")\nobj.SetP(\"radish\", \"name\")\nobj.SetP(2.5, \"price\")\narticles.Append(obj)\n\nobj2 := mmj.NewObj()\nobj2.SetP(\"fruit\", \"type\")\nobj2.SetP(\"apple\", \"name\")\nobj2.SetP(4, \"price\")\narticles.Append(obj)\n\nfmt.Println(articles.String())\n\n```\nResult\n```json\n[\n  {\n    \"type\":\"vegetable\",\n    \"name\":\"radish\",\n    \"price\": 2.5\n  },\n  {\n    \"type\":\"fruit\",\n    \"name\":\"apple\",\n    \"price\": 4\n  }\n]\n```\n\n## Insert arrays inside objects\n```go\nimport \"github.com/mohammadmohebi/mmj\"\n\n...\narticles := mmj.NewArray()\n\nobj := mmj.NewObj()\nobj.SetP(\"vegetable\", \"type\")\nobj.SetP(\"radish\", \"name\")\nobj.SetP(2.5, \"price\")\narticles.Append(obj)\n\nobj2 := mmj.NewObj()\nobj2.SetP(\"fruit\", \"type\")\nobj2.SetP(\"apple\", \"name\")\nobj2.SetP(4, \"price\")\narticles.Append(obj)\n\nbasket := mmj.NewObj()\nbasket.SetP(articles, \"basket\")\n\nfmt.Println(basket.String())\n\n```\nResult\n```json\n{\n  \"basket\" : [\n    {\n      \"type\":\"vegetable\",\n      \"name\":\"radish\",\n      \"price\": 2.5\n    },\n    {\n      \"type\":\"fruit\",\n      \"name\":\"apple\",\n      \"price\": 4\n    }\n  ]\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohammadmohebi%2Fmmj","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmohammadmohebi%2Fmmj","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohammadmohebi%2Fmmj/lists"}