Skip to content

About

JSON for Humans in GDExtension for Godot.

Topics

Resources

Stars

17 stars

Watchers

1 watching

Forks

Repository files navigation

Godot Asset Library Godot Asset Store

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.

JsonhGdextension

JsonhGdextension is a parser implementation of JSONH V1 & V2 for GDExtension using JsonhCpp.

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 Jsonh:

var jsonh:String = "[hello, world]"
var value:Variant = Jsonh.parse_element(jsonh).value
print(value) # ["hello", "world"]

Supported Platforms

JsonhGdextension aims to support every platform supported by the main Godot releases.

Note: Every supported platform has binaries for single/double precision and debug/release mode.

Platform Supported Note
Windows x64 ✅
Windows x32 ✅
Windows ARM64 ✅
Linux x64 ✅
Linux x32 ✅
Linux ARM64 ✅
Linux ARM32 ✅
macOS Universal ✅
Android x64 ✅
Android x32 ✅
Android ARM64 ✅
Android ARM32 ✅
iOS ARM64 ✅
Web WASM32 ✅
Web WASM64 ❌ WASM64 is not supported by Godot 4.4.

Dependencies

Limitations

Limited API

Since GDExtension is complex and GDScript has limitations, only two static methods (Jsonh.parse_element and Jsonh.parse_json) are exposed.

About

JSON for Humans in GDExtension for Godot.

Topics

Resources

Stars

17 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Used by

Contributors

Languages