JSON

/json

Command and ⌃⌘/ action

Premium

Type /json and some JSON, then Tab, to indent it, or /json-min to put it on one line. Both work on a selection with ⌃⌘/ and say where JSON is broken.

In use

In code
Bug report

Select it, then ⌃⌘/ and /json

Response body: {"id":42,"ok":true,"user":{"name":"Ana"}}

You get

Response body: { "id": 42, "ok": true, "user": { "name": "Ana" } }

In code
test.env

Select it, then ⌃⌘/ and /json-min

WEBHOOK_BODY={ "event": "refund", "amount": 18.50 }

You get

WEBHOOK_BODY={"event":"refund","amount":18.50}

In a paragraph
Support ticket

Select it, then ⌃⌘/ and /json

Hi Priya, The customer’s refund came back like this: {"order":1042,"status":"refunded","total":"£18.50"} Could you check why it was refunded twice? Sam

You get

Hi Priya, The customer’s refund came back like this: { "order": 1042, "status": "refunded", "total": "£18.50" } Could you check why it was refunded twice? Sam

Options set the indent (2 spaces, 4 spaces or a tab) and can sort the keys. Numbers and text stay exactly as written. Broken JSON is left as it is, and the status says where, such as “line 1, column 19: expected a comma.”

Also try

  • /json {"id":42,"ok":true}
  • /json [1,2,{"tags":[]}]
  • /json-min { "id": 42, "ok": true }
  • /json-min [ 1, 2, 3 ]
How you reach it
/json, in any app, or ⌃⌘/ on a selection
Network
None. It works on your Mac.
Version
1.0.0, by Little Keebo