1.0.8 • Published 3 years ago

json-viewer-js v1.0.8

Weekly downloads
79
License
MIT
Repository
-
Last release
3 years ago

JSON Viewer

One pretty json viewer by javascript

Home page: json-viewer-js

Example

import JsonViewer from './jsonViewer';

const testJson = `{
  "example1": [
      {
          "name": "test01",
          "age": 18,
          "gender": 0,
          "student": true,
          "children": null
      },
      {
          "name": "test02",
          "age": 19,
          "gender": 1,
          "student": true,
          "children": null
      }
  ],
  "example2": {
      "friuts": ["apple", "grape", "jujube", "pear"],
      "transport": ["taxi", "bus", "metro", "plane", "train"]
  }
}`

new JsonViewer({
    container: document.body, 
    data: testJson, 
    theme: 'light', 
    expand: false
});

Output Example

Light theme

npm.io

Dark theme

npm.io

API Reference

NameTypeDescDefaultRequired
containerDOM ObjectDOM elementnulltrue
dataStringJson data for render'{}'true
themeStringConfig for different theme(light or dark)lightfalse
expandBooleanConfig for if expand when loadedfalsefalse

End

If you like it, please give me a star, thanks!

Powered for: My JSON Editor

1.0.8

3 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago