https://github.com/gongo/json-reformat.git
git clone 'git://github.com/gongo/json-reformat.git'
json-reformat.el
is reformat tool for JSON.
You can install from MELPA with package.el
M-x package-install RET json-reformat
M-x json-reformat-region
json-reformat:indent-width (integer)
Change indentation level (default 4)
json-reformat:pretty-string? (boolean)
Specify whether to decode the string (default nil)
Example:
;; {"name":"foo\"bar","nick":"foo \u00e4 bar","description":"<pre>\nbaz\n</pre>","home":"/home/foobar"}
If nil:
{
"name": "foo\"bar",
"nick": "foo \u00e4 bar",
"description": "<pre>\nbaz\n<\/pre>",
"home": "\/home\/foobar"
}
Else t:
{
"name": "foo\"bar",
"nick": "foo รค bar",
"description": "<pre>
baz
</pre>",
"home": "/home/foobar"
}
From emacs 24.4, json-pretty-print
and json-pretty-print-buffer
(similar specifications as json-reformat-region
) was bundled.
MIT License. see json-reformat.el