Implementation
To use Hjson in your application you have two options
- Convert Hjson to JSON using any of the available tools or libraries. This can even be done by an external process.
- Use one of the Hjson libraries directly. They are easy to use and try to be language idiomatic.
Your users do not need to convert their existing JSON configs and can upgrade (or not) as they like.
Packages for Developers
Platform | Source | Package |
---|---|---|
JavaScript, Node.js & Browser | hjson-js | |
C#, .Net | hjson-cs | |
C++ | hjson-cpp | |
Go | hjson-go | |
Java | hjson-java | |
Lua | hjson-lua | |
PHP | hjson-php | |
Python | hjson-py | |
Rust | hjson-rust |
Also see tools and editor support.
Partial implementations
Platform | Description | Source/Package |
---|---|---|
C | jzon variant, based on Hjson | jzon-c |
Kotlin | does not pass all tests | kotlin.hjson |
Raku | Deserialization only | JSON::Hjson |
Ruby | Hjson Ruby parser | hjson-rb |
Rust | Deserialization only | deser-hjson |
Please open an issue if you port Hjson to another platform/language.
Tools with native support
Name | Link | Details |
---|---|---|
any-json: convert (almost) anything to JSON | see readme | |
gulp: the streaming build system | see readme | |
grunt: the JavaScript task runner | see readme | |
hjsonify: a browserify transform to require Hjson files | see readme | |
node-config: node.js application configuration | see wiki | |
nconf: hierarchical node.js configuration | nconf.file({ file: 'file.hjson', format: require('hjson').rt }); // round trips your comments | |
rc: non-configurable configuration loader for lazy people. | var conf=require('rc')('appname', {/*defaults*/}, null, require('hjson').parse); |