This Emacs package provides a reformatter for json and jsonlines files using the jq
utility.
Make sure jq is installed on your sytem.
Install the jq-format Melpa package using:
M-x package-install RET jq-format RET
If you use use-package, use something like this:
(use-package jq-format
:demand t
:after json-mode)
Use one of these commands via M-x
or bind them to a key:
jq-format-json-buffer
jq-format-json-region
jq-format-json-on-save-mode
A similar set of commands is avaiable for jsonlines data:
jq-format-jsonlines-buffer
jq-format-jsonlines-region
jq-format-jsonlines-on-save-mode
See the reformatter documentation for more information
This package deliberately has minimal configuration. Use M-x customize-group RET jq-format
or change these variables in your init.el
:
jq-format-command
jq-format-sort-keys
jq-format-extra-args
3-clause BSD. Copyright © 2019 wouter bolsterlee.
wouter bolsterlee. wbolster.
https://github.com/wbolster on github. star my repos. fork them. and so on.
https://twitter.com/wbolster on twitter. follow me. or say hi.