Skip to content

Latest commit

 

History

History
168 lines (110 loc) · 4.29 KB

README_en.md

File metadata and controls

168 lines (110 loc) · 4.29 KB

DanKeJson

中文 | English

NuGet

DanKeJson is a simple .Net library to handle conversions from and to JSON (JavaScript Object Notation) strings.

Quick-Start

Hello DanKeJson

Json to JsonData

Json to Object

JsonData to Json

Object to Json

Features

DanKeJson has incorporated a variety of features to facilitate development, including but not limited to:

  • Data transmission via the JsonData class
  • Implicit conversion operators
  • Tolerance for superfluous commas in arrays and objects
  • Single quotes are permissible in strings.
  • Comment allowance*
  • Conversion of undefined values to null
  • Key name allows no quotation marks

For more information on features, please refer to: Hello DanKeJson

*Note: The current version of DanKeJson's parser does not fully support comments. Comment support is handled by the CommentParser class using regular expressions, which may significantly impact parsing performance.

Future Tasks...

Deserialization:

  • Parser support for single-line and multi-line comments
  • Support for date formats
  • Support more dotnet version
  • Allow key names without quotes
  • Support for single quotes in strings
  • Allow trailing commas in arrays and objects

Serialization:

  • Support for serializing to JSON5 format

API

JSON

JSON5

JsonData

JsonData.Type

Publishing

Windows

./publish.bat

Using DanKeJson from an application

Download package

Package manager

NuGet\Install-Package DanKeJson -Version 1.4.1

.NET CLI

dotnet add package DanKeJson --version 1.4.1

PackageReference

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

Paket CLI

paket add DanKeJson --version 1.4.1

Script & Interactive

#r "nuget: DanKeJson, 1.4.1"

Cake

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

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

Alternatively, just copy the whole tree of files under ./publish/DanKeJson to your own project's source tree and integrate it with your development environment.

Requirements

DanKeJson currently targets and supports

  • .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

License

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.

Thanks

This project was developed using Rider, and we extend our gratitude to JetBrains for their support of DanKeJson.

JetBrains Logo (Main)

All Markdown files in this project were written using Hypora.

Reference

litjson - C#