Skip to content

lizoc/jsonplus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Json+

Just yet another JSON dialect.

NuGet Package PowerShell Gallery MIT License

Json+ is forked from HOCON.

What does this do?

Json+ is a JSON dialect that we think is easier to write by hand. This repo has parser for Json+, written in C#.

Json+ is initially forked from HOCON in October 2018, and the code base has diverged since. Some primary differences are:

  • PowerShell integration through the ConvertFrom-JsonPlus cmdlet
  • More robust substitution operations with several bug fixes
  • More terse syntax

Show me the money

A quick compare-and-contrast:

{
    "foo": "abc",
    "bar": "abc\ndef",
    "taz": {
        "z": "abcabc"
    }
}

If you have written JSON by hand, you probably have experienced these:

  • forget a comma delimiter between items in an array
  • had an extra comma delimiter at the last item in an array
  • tirelessly "quoting" your keys and strings
  • got lost with escape characters
  • no place to write your comments
  • wishing for variables

Json+ to the rescue!

foo = abc
# a comment!
bar = """abc
def"""
taz {
    z = ${foo}${foo}
}

Seriously, it is like writing an INI file, but with comments, multi-line, variables and stuff.

What's more! Json+ is a superset of JSON, so it can parse your existing JSON text as well.

Why would I use this?

First of all, you shouldn't use this if:

  • Your JSON is generated for serialization purposes
  • You are already happy with your JSON editing experience, probably using some fancy IDE
  • Every microsecond counts when you are parsing JSON

We are using Json+ as a project file in our build scripts, as configuration file, and data source for text templates.

Getting started

The latest package is available on NuGet. Simply reference it in your .NET project file or packages.config.

If you are interested in working with Json+ inside PowerShell, the latest module is hosted on PowerShell Gallery:

Install-Package JsonPlus

More details

Look at more examples here, or read the whole spec.

The documentation index is here.

Building from source

This repo is built on Windows 10.

Just clone this repo, cd to the repo directory, and execute things in the following order:

build configure
build release *

For more build options, run build /?.

About

Yet another Json dialect...

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published