Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

README.md

LightJson

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

Features

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

Basic Usage

Creating a JSON message

var json = new JsonObject()
	.Add("menu", new JsonArray()
		.Add("home")
		.Add("projects")
		.Add("about")
	)
	.ToString(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

Author

You can’t perform that action at this time.