Aller au contenu
uencoder

Spécification HJSON (Human JSON)

HJSON est un syntax pour humans, allowing comments, unquoted chaînes, et multiline valeurs pendant que remaining JSON-compatible.

Human-Friendly Syntax

HJSON eliminates the need for quotes on most strings and commas between elements. Comments are supported with # and // styles. Multiline strings use triple quotes or indented blocks. The format prioritizes readability for configuration files. HJSON can be losslessly converted to and from standard JSON.

no quotes
Unquoted strings
value: hello
no commas
Omit separators
newline separated
multiline
Triple-quote or indent
"""..."""

Conversion and Tooling

HJSON parsers convert to standard JSON for processing, preserving all data. Round-trip conversion maintains comments and formatting when using HJSON-native tools. The format is used in configuration for Node.js and Python projects. HJSON is not a data interchange format but a human authoring format. Tools exist for syntax highlighting in major editors.

to JSON
Lossless conversion
hjson -c
round-trip
Preserves comments
HJSON native
editors
VS Code, Vim, etc.
syntax support

Outils associés

参考链接