百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
J

json

> 编程语言
开源

一个非常简单的 C# JSON 解析器,仅有 350 行代码

342 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

一个非常简单的 C# JSON 解析器,仅有 350 行代码

Tiny Json

A really simple C# JSON parser in ~350 lines

  • Attempts to parse JSON files with minimal GC allocation
  • Nice and simple "[1,2,3]".FromJson>() API
  • Classes and structs can be parsed too!
csharp
class Foo 
{ 
  public int Value;
}
"{\"Value\":10}".FromJson()
  • Anonymous JSON is parsed into Dictionary and List
csharp
var test = "{\"Value\":10}".FromJson();
int number = ((Dictionary)test)["Value"];
  • No JIT Emit support to support AOT compilation on iOS
  • Attempts are made to NOT throw an exception if the JSON is corrupted or invalid: returns null instead.
  • Only public fields and property setters on classes/structs will be written to
  • You can optionally use [IgnoreDataMember] and [DataMember(Name="Foo")] to ignore vars and override the default name

Limitations:

  • No JIT Emit support to parse structures quickly
  • Limited to parsing (); } }
Save this as `JsonTest.cs` then compile and run with `mcs JsonTest.cs && mono JsonTest.exe`

## Installation

Simply copy and paste the [JSON Parser](https://raw.githubusercontent.com/zanders3/json/master/src/JSONParser.cs) and/or the [JSON Writer](https://raw.githubusercontent.com/zanders3/json/master/src/JSONWriter.cs) into your project. I also provide NuGet but I recommend the copy paste route ;)

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C#json-parserlow-memorynugetunity-3d

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言