Skip to content
0xMaxLab edited this page Mar 16, 2026 · 7 revisions

Welcome!

RichJSON is a powerful extension of the JSON format,
designed to make your JSON data highly modular and more compressed.

Key Features

  • RichJSON does not violate any JSON format conventions,
    which means it can still be read by any standard JSON parser or editor.
  • What makes RichJSON special compared to normal JSON files is its modularity, achieved through features such as:
    • referencing JSON objects/files/folders/envs
    • inheriting JSON objects/files/folders/envs
    • nested string interpolations
    • commands
  • And if that weren’t enough, you can also create custom modules to implement new commands for your specific use cases.
    And yes, there will be use cases... I promise!

How It Works

1. Define your structure

{   
	"data_template": {  
	    "data0": "value",    
	    "data1": "value",    
	    "data2": "value"  
	},  
	"applied_reference": "$ref:data_template"
}  

2. Resolve the data

import * as RichJson from "@rjson/parser"  
  
let obj = RichJson.parse(data);  

3. The Result

The output is a fully resolved, standard JSON object where all references are hydrated:

{   
	"data_template": {   
		"data0": "value",  
		"data1": "value",    
		"data2": "value"  
	},  
	"applied_reference": {    
		"data0": "value",  
	    "data1": "value",    
	    "data2": "value"  
	}
}  

PS: Start by understanding Command Categories.

Clone this wiki locally