{"id":13662019,"url":"https://github.com/hjson/hjson-cs","last_synced_at":"2026-03-09T10:06:42.846Z","repository":{"id":15364438,"uuid":"18095473","full_name":"hjson/hjson-cs","owner":"hjson","description":"Hjson for C#","archived":false,"fork":false,"pushed_at":"2026-03-09T00:52:53.000Z","size":226,"stargazers_count":124,"open_issues_count":6,"forks_count":17,"subscribers_count":9,"default_branch":"master","last_synced_at":"2026-03-09T05:59:16.979Z","etag":null,"topics":["c-sharp","hjson","maintainer-wanted"],"latest_commit_sha":null,"homepage":"https://hjson.github.io/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hjson.png","metadata":{"files":{"readme":"README.md","changelog":"history.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":"2014-03-25T09:49:07.000Z","updated_at":"2025-07-27T00:29:30.000Z","dependencies_parsed_at":"2022-09-01T00:24:40.549Z","dependency_job_id":null,"html_url":"https://github.com/hjson/hjson-cs","commit_stats":null,"previous_names":["laktak/hjson-cs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hjson/hjson-cs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hjson%2Fhjson-cs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hjson%2Fhjson-cs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hjson%2Fhjson-cs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hjson%2Fhjson-cs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hjson","download_url":"https://codeload.github.com/hjson/hjson-cs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hjson%2Fhjson-cs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30291104,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T02:57:19.223Z","status":"ssl_error","status_checked_at":"2026-03-09T02:56:26.373Z","response_time":61,"last_error":"SSL_read: 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":["c-sharp","hjson","maintainer-wanted"],"created_at":"2024-08-02T05:01:46.990Z","updated_at":"2026-03-09T10:06:42.834Z","avatar_url":"https://github.com/hjson.png","language":"C#","funding_links":[],"categories":["C\\#"],"sub_categories":[],"readme":"# hjson-cs\n\n[![nuget version](https://img.shields.io/nuget/v/Hjson.svg?style=flat-square)](https://www.nuget.org/packages/Hjson/)\n[![License](https://img.shields.io/github/license/hjson/hjson-cs.svg?style=flat-square)](https://github.com/hjson/hjson-cs/blob/master/LICENSE)\n\n[Hjson](http://hjson.github.io), a user interface for JSON\n\n![Hjson Intro](http://hjson.github.io/hjson1.gif)\n\nJSON is easy for humans to read and write... in theory. In practice JSON gives us plenty of opportunities to make mistakes without even realizing it.\n\nHjson is a syntax extension to JSON. It's NOT a proposal to replace JSON or to incorporate it into the JSON spec itself. It's intended to be used like a user interface for humans, to read and edit before passing the JSON data to the machine.\n\n```Hjson\n{\n  # specify rate in requests/second (because comments are helpful!)\n  rate: 1000\n\n  // prefer c-style comments?\n  /* feeling old fashioned? */\n\n  # did you notice that rate doesn't need quotes?\n  hey: look ma, no quotes for strings either!\n\n  # best of all\n  notice: []\n  anything: ?\n\n  # yes, commas are optional!\n}\n```\n\nSupported frameworks/runtimes include .NET Core, .NET 4.x \u0026 Mono.\n\nThis library includes two readers/writers that fully conform to the respective specification:\n\n- JSON\n- Hjson\n\nThe C# implementation of Hjson is based on [System.Json](https://github.com/mono/mono). For other platforms see [hjson.github.io](http://hjson.github.io).\n\n# Install from nuget\n\n```\nInstall-Package Hjson\n```\n\n# Usage\n\nYou can either\n\n- use this libary directly\n- or just convert Hjson to JSON and use it with your *favorite JSON library*.\n\n### Convert\n\n```c#\n// convert Hjson to JSON\nvar jsonString = HjsonValue.Load(filePath).ToString();\n\n// convert JSON to Hjson\nvar hjsonString = JsonValue.Load(\"test.json\").ToString(Stringify.Hjson);\n```\n\n### Read\n\n```c#\nvar jsonObject = HjsonValue.Load(filePath).Qo();\n```\n\n`HjsonValue.Load()` will accept both Hjson and JSON. You can use `JsonValue.Load()` to accept JSON input only.\n\n### Object sample\n\n```c#\nvar jsonObject = HjsonValue.Parse(\"{\\\"name\\\":\\\"hugo\\\",\\\"age\\\":5}\").Qo();\nstring name = jsonObject.Qs(\"name\");\nint age = jsonObject.Qi(\"age\");\n// you may prefer to get any value as string\nstring age2 = jsonObject.Qstr(\"age\");\n\n// or iterate over the members\nforeach (var item in jsonObject)\n{\n  Console.WriteLine(\"{0}: {1}\", item.Key, item.Value);\n}\n```\n\n### Array sample\n\n```c#\nvar jsonArray = HjsonValue.Parse(\"[\\\"hugo\\\",5]\").Qa();\nstring first = jsonArray[0];\n\n// or iterate over the members\nforeach (var item in jsonArray)\n  Console.WriteLine(item.ToValue());\n```\n\n### Nested sample\n\n```c#\nvar nested = HjsonValue.Parse(\"{\\\"partner\\\":{\\\"name\\\":\\\"John\\\",\\\"age\\\":23}}\").Qo();\nstring name = nested.Qo(\"partner\").Qs(\"name\", \"default\");\nint age = nested.Qo(\"partner\").Qi(\"age\", 77);\nstring gender = nested.Qo(\"partner\").Qs(\"gender\", \"unknown\");\n```\n\n### Create\n\n```c#\nvar jsonObject = new JsonObject\n{\n  { \"name\", \"John\" },\n  { \"age\", 23 },\n};\n// -\u003e { \"name\": \"John\", \"age\", 23 }\n\nJsonArray jsonArray = new JsonArray()\n{\n  \"John\",\n  23,\n};\n// -\u003e [ \"John\", 23 ]\n```\n\n### Modify\n\n```c#\njsonObject[\"name\"] = \"Hugo\";\njsonObject.Remove(\"age\");\n```\n\n### Write\n\n```c#\nHjsonValue.Save(jsonObject, \"file.hjson\"); // as Hjson\nHjsonValue.Save(jsonObject, \"file.json\"); // as JSON\n```\n\n### ToString()\n\n```c#\njsonObject.ToString(Stringify.Hjson); // Hjson output\njsonObject.ToString(Stringify.Formatted); // formatted JSON output\njsonObject.ToString(Stringify.Plain); // plain JSON output, default\njsonObject.ToString(); // plain\n```\n\nAlso see the [sample](sample).\n\n# API\n\nSee [api.md](api.md).\n\n## From the Commandline\n\nA commandline tool to convert from/to Hjson is available in the cli folder.\n\nFor other tools see [hjson.github.io](http://hjson.github.io).\n\n# Source/Projects\n\nSolutions in the root folder target .NET Core.\n\nSolutions for .NET 4.x can be found in the legacy folder.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhjson%2Fhjson-cs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhjson%2Fhjson-cs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhjson%2Fhjson-cs/lists"}