danke - DanKeJson 1.4.4-b3b4e0c

a simple Json library for the .Net

PM> Install-Package DanKeJson -Version 1.4.4-b3b4e0c -Source https://www.myget.org/F/danke/api/v3/index.json

Copy to clipboard

> nuget.exe install DanKeJson -Version 1.4.4-b3b4e0c -Source https://www.myget.org/F/danke/api/v3/index.json

Copy to clipboard

> dotnet add package DanKeJson --version 1.4.4-b3b4e0c --source https://www.myget.org/F/danke/api/v3/index.json

Copy to clipboard
<PackageReference Include="DanKeJson" Version="1.4.4-b3b4e0c" />
Copy to clipboard
source https://www.myget.org/F/danke/api/v3/index.json

nuget DanKeJson  ~> 1.4.4-b3b4e0c
Copy to clipboard

> choco install DanKeJson --version 1.4.4-b3b4e0c --source https://www.myget.org/F/danke/api/v2

Copy to clipboard
Import-Module PowerShellGet
Register-PSRepository -Name "danke" -SourceLocation "https://www.myget.org/F/danke/api/v2"
Install-Module -Name "DanKeJson" -RequiredVersion "1.4.4-b3b4e0c" -Repository "danke" -AllowPreRelease
Copy to clipboard

DanKeJson

中文 | English

NuGet MyGet

DanKeJson 是一个.Net平台上的精简小巧的 JSON 类库,用于处理 JSON (JavaScript Object Notation) 字符串之间的转换。

快速开始

Hello DanKeJson

Json to JsonData

Json to Object

JsonData to Json

Object to Json

特性

DanKeJson 为了方便开发使用,添加了许多特性,包括但不限于:

  • JsonData 类传递数据
  • 隐式转换操作符
  • 支持读取.jsonl(JSONL)
  • 允许数组、对象的多余逗号(JSON5)
  • 键名无需引号(JSON5)
  • 字符串允许使用单引号(JSON5)
  • 允许注释*
  • 将未经定义的值转换为null
  • 键名允许不使用引号

更多特性相关内容请看:Hello DanKeJson

*: 当前版本的 DanKeJson解析器部分中尚未支持注释,注释支持由CommentParser类通过正则表达式忽略,可能会严重影响解析性能。

将来要做的事...

反序列化部分:

  • 解析器支持单行注释与多行注释
  • 支持日期格式
  • 支持更多 .net 版本
  • 键名无需引号
  • 字符串支持单引号
  • 允许数组、对象的多余逗号

序列化部分:

  • 支持序列化为JSON5格式

杂项:

  • 支持序列化反序列化MessagePack
  • 使用Simd技术加快反序列化

API

JSON

JSON5

JsonData

JsonData.Type

打包为Nuget发行包

Windows

./build.ps1

Mac OS / Linux

./build.sh

在你的应用中安装 DanKeJson

点击下载

Package manager

NuGet\Install-Package DanKeJson -Version 1.4.3

.NET CLI

dotnet add package DanKeJson --version 1.4.3

PackageReference

<PackageReference Include="DanKeJson" Version="1.4.3" />

Paket CLI

paket add DanKeJson --version 1.4.3

Script & Interactive

#r "nuget: DanKeJson, 1.4.3"

Cake

// Install DanKeJson as a Cake Addin
#addin nuget:?package=DanKeJson&version=1.4.3

// Install DanKeJson as a Cake Tool
#tool nuget:?package=DanKeJson&version=1.4.3

或者,只需复制目录./publish/DanKeJson到您自己项目的源代码树中,并将其与您的开发环境集成。

开发平台

DanKeJson 目前支持的平台:

  • .NET 9.0
  • .NET 8.0
  • .NET 7.0
  • .NET 6.0
  • .NET 5.0
  • .NET Standard 2.1
  • .NETcoreapp3.1
  • .NETcoreapp3.0
  • Godot (.Net)
  • Mono
  • Unity

开源许可协议

中文翻译版

MIT License

Copyright (c) 2023 - present DanKe

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

特别鸣谢

本项目使用 Rider 开发,感谢 JetBrains 对 DanKeJson 的支持。

JetBrains Logo (Main) logo.

本项目所有Markdown文件使用 Hypora 书写。

参考项目

litjson - C#

net8.0 net7.0 net6.0 net5.0 netstandard2.1 netcoreapp3.0 netcoreapp3.1

  • .NETCoreApp 3.0
  • .NETCoreApp 3.1
  • .NETFramework 5.0
  • .NETFramework 6.0
  • .NETFramework 7.0
  • .NETFramework 8.0
  • .NETFramework 9.0
  • .NETStandard 2.1
  • .NETCoreApp 3.0: 3.0.0.0
  • .NETCoreApp 3.1: 3.1.0.0
  • .NETFramework 5.0: 5.0.0.0
  • .NETFramework 6.0: 6.0.0.0
  • .NETFramework 7.0: 7.0.0.0
  • .NETFramework 8.0: 8.0.0.0
  • .NETFramework 9.0: 9.0.0.0
  • .NETStandard 2.1: 2.1.0.0

Owners

DanKe123abc

Authors

DanKe

Project URL

https://github.com/DanKE123abc/DanKeJson

License

Unknown

Tags

DanKeJson DanKE123abc Json DanKe dankejson

Info

0 total downloads
0 downloads for version 1.4.4-b3b4e0c
Download (90.18 KB)
Found on the current feed only

Package history

Version Size Last updated Downloads Mirrored?
1.4.4-b3b4e0c 90.18 KB Sat, 14 Jun 2025 10:22:16 GMT 0
1.4.4-a4aff6c 90.12 KB Sat, 14 Jun 2025 12:13:22 GMT 0
1.4.4-012784d 89.94 KB Sat, 14 Jun 2025 10:04:02 GMT 0
1.4.3-9dcea45 89.16 KB Sat, 14 Jun 2025 09:34:57 GMT 0
1.4.3-9a03332 86.68 KB Sun, 04 May 2025 03:21:16 GMT 0
1.4.3-97cf850 87.44 KB Sun, 08 Jun 2025 15:15:45 GMT 0
1.4.3-924790c 86.89 KB Fri, 02 May 2025 02:28:44 GMT 0
1.4.3-89335ef 86.52 KB Sat, 29 Mar 2025 03:05:01 GMT 0
1.4.3-79315fd 86.71 KB Sat, 29 Mar 2025 04:06:26 GMT 0
1.4.3-542edbf 88.82 KB Sat, 14 Jun 2025 03:21:30 GMT 0
1.4.3-46d2894 89.38 KB Fri, 13 Jun 2025 15:59:35 GMT 0
1.4.3-0197b2b 86.26 KB Sat, 29 Mar 2025 02:39:15 GMT 0
1.4.3-00f1d9f 88.78 KB Sat, 14 Jun 2025 03:25:02 GMT 0
1.4.3-3923668 75.91 KB Sat, 29 Mar 2025 02:15:25 GMT 0