3 ms·
Nice work. I use this automator for pretty printing JSON. import json import sys text = sys.stdin.read() try: print json.dumps(json.loads(text),
by shill 11y ago
Nice work. I use this automator for pretty printing JSON.
import json
import sys
text = sys.stdin.read()
try:
print json.dumps(json.loads(text), sort_keys=False, indent=4)
except Exception as e:
print e
- vladdanilov 11y agoThank you. I thought on including some developer formatters. But decided it should be left to code editors. In particular there is JSCS linter (http://jscs.info/ http://jscs.info/), or SublimeLinter-JSCS as Sublime Text plugin (https://packagecontrol.io/packages/SublimeLinter-jscs https://packagecontrol.io/packages/SublimeLinter-jscs) which can do this and much more.