Skip to content

🤘An Alfred workflow that formatting a copied json string to the pasteboard using jq.

License

Notifications You must be signed in to change notification settings

mayooot/alfred-json-format

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Alfred-Json-Format

Overview

🤘An Alfred workflow that formatting a copied json string to the pasteboard using jq.

Alfred.png

Install

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

Usage

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.

screenshot.png

Example

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.

alert.png

jq: parse error: Expected another key-value pair at line 1, column 18

Contribute

Feel free to open issues and pull requests. Any feedback is highly appreciated!

About

🤘An Alfred workflow that formatting a copied json string to the pasteboard using jq.

Resources

License

Stars

Watchers

Forks

Packages

No packages published