json-highlight
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

json-highlight

NPM version

A Json to Html formatter, Live Demo

Install

  • using npm
npm i json-highlight
  • using in browser
<script scr="//unpkg.com/json-highlight"></script>
<!-- or -->
<script scr="//cdn.jsdelivr.net/npm/json-highlight"></script>

Usage

document.querySelector('pre').innerHTML = jsonHighlight({
    number: 123,
    string: 'hello',
    array: [
        2e60,
        -0.2,
        null,
        true,
        {
            nesting: [],
        },
    ],
});

Todos:

  • 可配置内联颜色
  • 可配置类名前缀
  • 全局配置
  • cli接口

Particular Thanks

Package Sidebar

Install

npm i json-highlight

Weekly Downloads

2

Version

0.1.2

License

MIT

Unpacked Size

8.37 kB

Total Files

10

Last publish

Collaborators

  • bowencool