JsonhCs 1.4.0

dotnet add package JsonhCs --version 1.4.0
                    
NuGet\Install-Package JsonhCs -Version 1.4.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="JsonhCs" Version="1.4.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="JsonhCs" Version="1.4.0" />
                    
Directory.Packages.props
<PackageReference Include="JsonhCs" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add JsonhCs --version 1.4.0
                    
#r "nuget: JsonhCs, 1.4.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=JsonhCs&version=1.4.0
                    
Install JsonhCs as a Cake Addin
#tool nuget:?package=JsonhCs&version=1.4.0
                    
Install JsonhCs as a Cake Tool

JsonhCs

NuGet

JSON for Humans.

JSON is great. Until you miss that trailing comma... or want to use comments. What about multiline strings? JSONH provides a much more elegant way to write JSON that's designed for humans rather than machines.

Since JSONH is compatible with JSON, any JSONH syntax can be represented with equivalent JSON.

JsonhCs is an implementation of JSONH v1.

Example

{
    // use #, // or /**/ comments
    
    // quotes are optional
    keys: without quotes,

    // commas are optional
    isn\'t: {
        that: cool? # yes
    }

    // use multiline strings
    haiku: '''
        Let me die in spring
          beneath the cherry blossoms
            while the moon is full.
        '''
    
    // compatible with JSON5
    key: 0xDEADCAFE

    // or use JSON
    "old school": 1337
}

Usage

Everything you need is contained within JsonhReader:

string Jsonh = """
    {
        this is: awesome
    }
    """;
string Element = JsonhReader.ParseElement<string>(Jsonh).Value!;
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on JsonhCs:

Package Downloads
SystemCall

A command-parsing library inspired by Jinx.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.4.0 84 3/29/2025
1.3.0 440 3/25/2025
1.2.0 131 3/20/2025
1.1.0 131 3/19/2025
1.0.0 129 3/19/2025