JSON to HTML Formatter
npm install vue-tjson2htmlPrettyprint JSON to HTML
It is available through npm
npm install tjson2html
tjson2html will take a JSON document and add markup to it so it can be styled in a browser.
`` js`
var tjson2html = require('tjson2html')
var html = tjson2html({hello:'world'})
console.log(html);
The above example will print the following HTML
` html`
hello "world"
` css style is``
.tjson {
font-size: 12px;
font-family: monospace;
}
.tjson.group {
margin-left: 10px;
}
.tjson.group:after {
content: '}';
}
.tjson.group:before {
content: '{';
}
.tjson.key {
font-weight: bold;
display: inline-block;
min-width: 50px;
}
.tjson.key:after {
content: ':';
}
.tjson.val {
color: #555;
}
Afterwards you can use css to style your output to your liking.
MIT