From 4d50e57a05e7059b67c837bac74b1953c7d55f06 Mon Sep 17 00:00:00 2001 From: Martin Leduc <31558169+DecimalTurn@users.noreply.github.com> Date: Sun, 17 May 2026 03:34:52 +0000 Subject: [PATCH] Add seperate Tools and Libraries page --- index.md | 37 ++---------------------------- tools.md | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+), 35 deletions(-) create mode 100644 tools.md diff --git a/index.md b/index.md index bd974b0..262e94f 100644 --- a/index.md +++ b/index.md @@ -120,42 +120,9 @@ For a visual representation of the grammar rules, see the JSONC railroad diagram - [JSONC Railroad Diagram]({{ '/grammar/railroad-diagram.html' | relative_url }}) ## Tools and Libraries -Several tools and libraries support JSONC, enabling developers to parse and generate JSONC data easily. -Here is a non-exhaustive list: - -**C++** -- [nlohmann/json](https://github.com/nlohmann/json) `ignore_comments`, `ignore_trailing_commas` -- [RapidJSON](https://github.com/Tencent/rapidjson) `kParseCommentsFlag`, `kParseTrailingCommasFlag` -- [stephenberry/glaze](https://github.com/stephenberry/glaze) - -**Elixir** -- [massivefermion/jsonc](https://github.com/massivefermion/jsonc) - -**Go** -- [HuJSON](https://github.com/tailscale/hujson) -- [tidwall/jsonc](https://github.com/tidwall/jsonc) - -**Java** -- [Jackson](https://github.com/FasterXML/jackson-core) `JsonFactory.enable(JsonReadFeature.ALLOW_JAVA_COMMENTS)` - -**JavaScript/TypeScript**: -- [microsoft/node-jsonc-parser](https://github.com/microsoft/node-jsonc-parser) - -**Kotlin** -- [kotlinx.serialization.json](https://kotlinlang.org/api/kotlinx.serialization/kotlinx-serialization-json/kotlinx.serialization.json/-json-builder/allow-comments.html) - -**PHP** -- [otar/jsonc](https://github.com/otar/jsonc) - -**Python** -- [n-takumasa/json-with-comments](https://github.com/n-takumasa/json-with-comments) - -**Rust** -- [dprint/jsonc-parser](https://github.com/dprint/jsonc-parser) - -**Swift** -- [steelbrain/JSONCKit](https://github.com/steelbrain/JSONCKit) +For a community-maintained list of JSONC tools and libraries, please refer to the following page: +- [Tools and Libraries]({{ '/tools.html' | relative_url }}) ## APPENDIX A: Trailing Commas and JSONC diff --git a/tools.md b/tools.md new file mode 100644 index 0000000..f78d246 --- /dev/null +++ b/tools.md @@ -0,0 +1,68 @@ +--- +layout: default +title: JSONC +--- + +# Tools and Libraries + +Several tools and libraries support JSONC, enabling developers to parse and generate JSONC data easily. This is a non-exhaustive list organized by programming language. + +## Parsers + +| Language | Tool/Library | Comments | Trailing Commas | Notes | +|----------- |---------------------------------------------------|----------|-----------------|--------------------------------| +| C++ | [nlohmann/json][nlohmann] | 🟡 [^1] | 🟡 [^2] | | +| C++ | [RapidJSON][rapidjson] | 🟡 [^3] | 🟡 [^4] | | +| C++ | [stephenberry/glaze][glaze] | 🟢 [^5] | 🔴 | | +| Elixir | [massivefermion/jsonc][massivefermion] | 🟢 | 🟢 | Includes additional extensions | +| Go | [HuJSON][hujson] | 🟢 | 🟢 | | +| Go | [tidwall/jsonc][tidwall] | 🟢 | 🟢 | | +| Java | [Jackson][Jackson] | 🟡 [^6] | 🟡 [^7] | | +| JavaScript | [microsoft/node-jsonc-parser][msft] | 🟢 | 🟡 [^8] | | +| Kotlin | [kotlinx.serialization.json][kotlinx] | 🟡 [^9] | 🟡 [^10] | | +| PHP | [otar/jsonc][otar] | 🟢 | 🟢 | | +| Python | [n-takumasa/json-with-comments][n-takumasa] | 🟢 | 🟢 | | +| Rust | [dprint/jsonc-parser][dprint] | 🟢 | 🟢 | | +| Swift | [steelbrain/JSONCKit][steelbrain] | 🟢 | 🟢 | | + +Legend: + +🟢: Default support
+🟡: Optional support
+🔴: Unsupported
+ +[otar]: https://github.com/otar/jsonc +[steelbrain]: https://github.com/steelbrain/JSONCKit +[hujson]: https://github.com/tailscale/hujson +[rapidjson]: https://github.com/Tencent/rapidjson +[nlohmann]: https://github.com/nlohmann/json +[glaze]: https://github.com/stephenberry/glaze +[tidwall]: https://github.com/tidwall/jsonc +[Jackson]: https://github.com/FasterXML/jackson-core +[massivefermion]: https://github.com/massivefermion/jsonc +[msft]: https://github.com/microsoft/node-jsonc-parser +[kotlinx]: https://kotlinlang.org/api/kotlinx.serialization/kotlinx-serialization-json/ +[n-takumasa]: https://github.com/n-takumasa/json-with-comments +[dprint]: https://github.com/dprint/jsonc-parser + +
+ +[^1]: Use `ignore_comments` + +[^2]: Use `ignore_trailing_commas` + +[^3]: Use `kParseCommentsFlag` + +[^4]: Use `kParseTrailingCommasFlag` + +[^5]: Use `glz::read_jsonc` (or using options: `glz::opts{.comments = true}`). See [Documentation](https://github.com/stephenberry/glaze/blob/main/docs/json.md#json-with-comments-jsonc). + +[^6]: Use `JsonFactory.enable(JsonReadFeature.ALLOW_JAVA_COMMENTS)` + +[^7]: Use `JsonFactory.enable(JsonReadFeature.ALLOW_TRAILING_COMMA)` + +[^8]: Use `allowTrailingComma: true` + +[^9]: Use `allowComments`. See [Documentation](https://kotlinlang.org/api/kotlinx.serialization/kotlinx-serialization-json/kotlinx.serialization.json/-json-builder/allow-comments.html). + +[^10]: Use `allowTrailingComma`. See [Documentation](https://kotlinlang.org/api/kotlinx.serialization/kotlinx-serialization-json/kotlinx.serialization.json/-json-builder/allow-trailing-comma.html). \ No newline at end of file