als-jpretty
v0.6.0
Published
Small class for turning json file to html code for pretty print
Downloads
12
Readme
als-jpretty
als-jpretty is a small class for turning json file to html code for pretty print. The class get object as parameter and return string which is html code with styles and js code.
Front end use
<div id="here"></div>
<script src="jpretty.js"></script>
<script>
let json = {some:['valu1','value2'],some1:'value'}
// Class option
let dom = document.getElementById('here')
dom.innerHTML = new Pretty(json).run() // return html code
// Function option
pretty(json,'here') // bind html code as element.innerHTML with id
</script>
Backend use
let string = new Pretty(json).run() // return html code