How to format JSON message to read easily

Asked

Viewed 1,057 times

3

I need to do JSON message DEBUG. I would like one to have available a formatting mechanism similar to the one you have in Eclipse for formatting Java and Javascript code, but via console.

2 answers

2


There are several formatters for JSON message but what I like most is JSBeautifier. You can use it by simply copying your code to the Clipboard and opening the site Jsbeautifier.ORG and then gluing the contents to the indicated field. Press Ctrl+Enter to perform the formatting.

The JSBeautifier also supports use via vi console NODE JS or installing the version Python.

See the details in http://jsbeautifier.org.

  • 1

    It also has http:/jsonlint.com/, which validates and formats JSON.

1

The tool underscore-cli should serve very well for that purpose.

inserir a descrição da imagem aqui

You may be using it as follows:

cat data.json | underscore print --color

Browser other questions tagged

You are not signed in. Login or sign up in order to post.