Skip to main content

FracturedJson - Human-Readable JSON Formatting

·133 words·1 min
Kostiantyn Lysenko
Author
Kostiantyn Lysenko

FracturedJson is a JSON formatter that aligns similar structures like table columns, keeps simple arrays on one line, and collapses short objects.

brew install fracturedjson

The binary is called fracjson. Pipe any JSON through it:

echo '{"users":[{"name":"Alice","age":30,"roles":["admin","editor"],"active":true},{"name":"Bob","age":25,"roles":["viewer"],"active":false},{"name":"Charlie","age":35,"roles":["admin","viewer","editor"],"active":true}],"settings":{"theme":"dark","notifications":{"email":true,"sms":false,"push":true},"limits":[100,200,300,400,500]}}' | fracjson
{
    "users"   : [
        { "name": "Alice",   "age": 30, "roles": ["admin",  "editor"          ], "active": true  },
        { "name": "Bob",     "age": 25, "roles": ["viewer"                    ], "active": false },
        { "name": "Charlie", "age": 35, "roles": ["admin",  "viewer", "editor"], "active": true  }
    ],
    "settings": {
        "theme"        : "dark",
        "notifications": {"email": true, "sms": false, "push": true},
        "limits"       : [100, 200, 300, 400, 500]
    }
}

The users array reads like a table. The settings block stays compact because each value fits on a single line. Standard formatters would spread this across 30+ lines with no visual structure.

https://github.com/j-brooke/FracturedJson