als-jpretty

0.6.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i als-jpretty

Weekly Downloads

3

Version

0.6.0

License

ISC

Unpacked Size

3.71 kB

Total Files

3

Last publish

Collaborators

  • alexsorkin