🤘An Alfred workflow that formatting a copied json string to the pasteboard using jq
.
You must first install jq
.
brew install jq
And You can get Alfred-Json-Format
via release or git clone
this repo.
git clone https://github.com/mayooot/alfred-json-format
You need to copy the json string that needs to be formatted and invoke the Alfred shortcut, type json
and enter.
The formatted json will then appear on your pasteboard.
Once we have copied the json string, call the Alfred shortcut, type json
and enter.
{"foo":0,"bar":1}
Your pasteboard will then append a formatted json string that looks like this:
{
"foo": 0,
"bar": 1
}
Of course, if you copy an error json string, it looks like this:
{"foo":0,"bar":1,}
There will then be a message telling you that this json formatting failed, and you can use ⌘ + v
to view the error
message.
jq: parse error: Expected another key-value pair at line 1, column 18
Feel free to open issues and pull requests. Any feedback is highly appreciated!