html-json-highlight

Html Json Highlight

Usage no npm install needed!

<script type="module">
  import htmlJsonHighlight from 'https://cdn.skypack.dev/html-json-highlight';
</script>

README

Welcome to Html Json Highlight

Browser Support

Chrome Firefox Safari Opera Edge IE
Latest ✔ Latest ✔ Latest ✔ Latest ✔ Latest ✔ 11 ✔

Install Command:

npm install html-json-highlight --save

Use Module

import HtmlJsonHighlight from 'html-json-highlight';

const Demo = new HtmlJsonHighlight({
    string: 'hello',
    number: 123,
    boolean: true,
    object: {
        string: 'world',
        number: 321,
        false
    },
    array: [
        'lZiMUl',
        258,
        true
    ],
    
});

// Simulator koa Route
Route.get('/', async socket => {
    socket.status = 200;
    socket.type = 'text/html';
    socket.response.body =  await Demo.body(false);
})