{"id":13730156,"url":"https://github.com/halak/jvalue","last_synced_at":"2025-10-09T09:22:43.664Z","repository":{"id":12534149,"uuid":"15204123","full_name":"halak/jvalue","owner":"halak","description":"super lightweight C# json parser","archived":false,"fork":false,"pushed_at":"2023-12-02T13:45:49.000Z","size":696,"stargazers_count":22,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-09-03T22:18:37.350Z","etag":null,"topics":["c-sharp","json","json-parser","lightweight"],"latest_commit_sha":null,"homepage":"","language":"C#","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/halak.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}},"created_at":"2013-12-15T13:41:12.000Z","updated_at":"2023-09-18T21:29:57.000Z","dependencies_parsed_at":"2024-01-06T14:48:57.427Z","dependency_job_id":"4ecf13fd-6e4f-43b4-8966-a2fa4f20387f","html_url":"https://github.com/halak/jvalue","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/halak/jvalue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halak%2Fjvalue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halak%2Fjvalue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halak%2Fjvalue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halak%2Fjvalue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/halak","download_url":"https://codeload.github.com/halak/jvalue/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halak%2Fjvalue/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001122,"owners_count":26083021,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","json","json-parser","lightweight"],"created_at":"2024-08-03T02:01:10.688Z","updated_at":"2025-10-09T09:22:43.635Z","avatar_url":"https://github.com/halak.png","language":"C#","funding_links":[],"categories":["C#"],"sub_categories":[],"readme":"JValue\n======\nLightweight C# Json Parser.  \nJValue is simple and pure.  \n\n\nFeatures\n--------\n- Pros\n  - Small memory footprint. (no heap allocation)\n  - Fastest parse.\n  - Easy to install.\n  - Easy to use.\n  - Unity3D friendly.\n  - Multithread safe. (JValue is immutable type)\n- Cons\n  - When you get to repeat the same key, it is inefficient.\n  - Object mapping NOT supported. (`System.Reflection`)\n\n\nSimple usage\n------------\n```cs\nJValue location = JValue.Parse(@\"{\"\"x\"\":10, \"\"y\"\":20}\");\nConsole.WriteLine((int)location[\"x\"]); // 10\nConsole.WriteLine((int)location[\"y\"]); // 20\nConsole.WriteLine(location[\"z\"].ToString()); // null\n\nvar person = new Dictionary\u003cstring, JValue\u003e()\n{\n    {\"name\", \"John\"},\n    {\"age\", 27},\n};\nConsole.WriteLine(new JValue(person).ToString()); // {\"name\":\"John\",\"age\":27}\n```\n\n\nMechanism\n---------\n1. `JValue` is `struct`.\n2. `JValue` has three members. `{string source, int startIndex, int length}`\n\n```cs\n// raw source\n// {\"name\":\"John\", \"age\":27, \"friend\":{\"name\":\"Tom\"}}\nJValue person = JValue.Parse(...);\n// person.source = ...\n// person.startIndex = 0\n// person.length = 50\n\nJValue name = person[\"name\"];\n// name.source = person.source\n// name.startIndex = 8\n// name.length = 6\n\nJValue age = person[\"age\"];\n// age.source = person.source\n// age.startIndex = 22\n// age.length = 2\n\nJValue friend = person[\"friend\"];\n// friend.source = person.source\n// friend.startIndex = 35\n// friend.length = 14\n\nJValue friendName = friend[\"name\"];\n// friendName.source = friend.source = person.source\n// friendName.startIndex = 43\n// friendName.length = 5\n\nstring nameValue = (string)name; // At this time, encode string.\nint ageValue = (int)age; // At this time, parse int.\n```\n\nUsage\n-----\n```cs\nJValue book = JValue.Parse(@\"{\n    \"\"name\"\": \"\"Json guide\"\",\n    \"\"pages\"\": 400,\n    \"\"tags\"\": [\"\"computer\"\", \"\"data-interchange format\"\", \"\"easy\"\"],\n    \"\"price\"\": {\"\"usd\"\":0.99, \"\"krw\"\":1000}\n}\");\nstring name = book[\"name\"];\nConsole.WriteLine(\"Name: {0}\", name);\n\nint pages = book[\"pages\"];\nConsole.WriteLine(\"Pages: {0}\", pages);\n\nConsole.WriteLine(\"Primary tag: {0}\", book[\"tags\"][0].AsString());\nConsole.WriteLine(\"Tags:\");\nforeach (var item in book[\"tags\"].Array())\n    Console.WriteLine(\"\\t{0}\", item);\nConsole.WriteLine(\"Unknown tag: {0}\", book[\"tags\"][100].AsString());\n\nJValue price = book[\"price\"];\nConsole.WriteLine(\"Price: ${0}\", (double)price[\"usd\"]);\nConsole.WriteLine(\"\");\nConsole.WriteLine(\"Reserialization\");\nConsole.WriteLine(book.Serialize(false));\n\n/*\nName: Json guide\nPages: 400\nPrimary tag: computer\nTags:\n        \"computer\"\n        \"data-interchange format\"\n        \"easy\"\nUnknown author:\nPrice: $0.99\n\nReserialization\n{\"name\":\"Json guide\",\"pages\":400,\"tags\":[\"computer\",\"data-interchange format\",\"easy\"],\"price\":{\"usd\":0.99,\"krw\":1000}}\n*/\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalak%2Fjvalue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhalak%2Fjvalue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalak%2Fjvalue/lists"}