Skip to content

damphat/damphat.Json

Repository files navigation

damphat.Json

Json with advanced features

  • lightweight javascript with hight performance
  • basic expressions 2*(a+b)/c
  • variables
  • single quote
  • optional commas
  • trailing commas
  • interact with .NET objects and methods via context
  • and mores ...

basic

json = @"
{
  city: 'Saigon'
  location: [10, 100]
}
";

var city = JSON.Parse(json);

Use it as a calculator

var result = JSON.Parse(" (145 + 47) / 2 ");

Hack with context

var context = new Dictionary<string, object>();
context["PI"] = Math.PI;

var result = JSON.Parse(" 2 * PI ", context);

About

JSON with variables and expressions ...

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages