json table
Json table is an easy way to preview your json data in table
Install
Install via npm
npm install json-table
Include
var json_tb = require('json-table');
Usage
var json_tb_out = 'sample.json' chars: 'top': '═' 'top-mid': '╤' 'top-left': '╔' 'top-right': '╗' 'bottom': '═' 'bottom-mid': '╧' 'bottom-left': '╚' 'bottom-right': '╝' 'left': '║' 'left-mid': '╟' 'mid': '─' 'mid-mid': '┼' 'right': '║' 'right-mid': '╢' 'middle': '│' { table // **have to call show() function to print out the table**}
or
var json_tb_out = <JSON object> config callback;
- Arguments:
- json file, or json object (json) : the first argument can be a json file or a json object
- configure of the table (object) :
optional
see detail in https://github.com/LearnBoost/cli-table - callback (function) : callback function
Example
Here is a sample json
will convert into table like
License
MIT @chilijung