LightJson Save

A simple JSON library for C#.

Project README

LightJson

A minimalist JSON library designed to easily encode and decode JSON messages.

Build and Tests

Features

  • Strict adherence to JSON Standard as defined in json.org.
  • Expressive fluent API.
  • Configurable output (minified/pretty).
  • Enhanced debugging data for Visual Studio.

Usage

Creating a JSON message

var json = new JsonObject
{
	["menu"] = new JsonArray
	{
		"home",
		"projects",
		"about",
	}
}.ToString(pretty: true);

JSON output:

{
	"menu": [
		"home",
		"projects",
		"about"
	]
}

Reading a JSON message

In this example, the variable json contains the string generated in the previous example.

var menu = JsonValue.Parse(json)["menu"].AsJsonArray;

foreach (var item in menu)
{
	Console.WriteLine(item);
}

Console output:

home
projects
about

License

MIT License (Read License).

Author

Contributors

  • Trevor Stavropoulos (tstavropoulos) [email protected]
  • Sam Harwell (sharwell)
  • saiedkia
  • Björn Hellander (bjornhellander)
  • Vitor Rodrigues (vsilvar)
Open Source Agenda is not affiliated with "LightJson" Project. README Source: MarcosLopezC/LightJson
Stars
59
Open Issues
0
Last Commit
7 months ago
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating