simple-json-viewer

0.0.3 • Public • Published

simple-json-viewer

A simple web component to display json data

Usage

Plain HTML

<script type="module" src="https://unpkg.com/simple-json-viewer"></script>

<json-viewer data='{"some": "json", "array": [0, true, "2"] }'></json-viewer>

With Javascript

import "https://unpkg.com/simple-json-viewer";

const jv = document.createElement("json-viewer");
// data can be any javascript variable that can stringify to json
jv.data = { some: "json", array: [0, true, "2"] };
document.body.append(jv);

// can also expand all or collapse all
jv.expandAll();
jv.collapseAll();

Readme

Keywords

none

Package Sidebar

Install

npm i simple-json-viewer

Weekly Downloads

3

Version

0.0.3

License

none

Unpacked Size

34.8 kB

Total Files

6

Last publish

Collaborators

  • yieldray