fmt-obj - formatting JSON for readability - OSS Daily

Daily Open Source News for IT Engineer and Designer

Breaking

Home Top Ad

Post Top Ad

Thursday, November 9, 2017

fmt-obj - formatting JSON for readability

The use of Web API becomes commonplace, and JSON is often used as a data format to be sent and received. JSON is easy to understand because there is no redundancy compared to XML, but it is not something that people can see immediately what it sees.

I would like to use fmt-obj there. It shapes JSON into an easy-to-understand format.

How to use fmt-obj

The result is look like this.


Just pass JSON as it is when using fmt - obj.
const format = require('fmt-obj');console.log(format(json));
Then, the key parts are displayed properly in a form that is easy to understand as shown below.
$ node test.js    message: "hello world"    dev: trueawesomeness: 9.99    body:        these: null        are: "string"        some: 12        props: false
If it is the output result of fmt-obj, the contents of JSON will be clearly understood. It is easy to see because types such as letters, numbers, booleans etc. are also displayed separately. It seems that there are many opportunities to use if you install it when developing with JSON.


fmt-obj is open source software (MIT License) made by node / JavaScript.

GitHub - queckezz/fmt-obj: Prettifies any javascript object in your console. Make it look awesome!

No comments:

Post a Comment

Post Bottom Ad