Gran visor JSON de Performant en Vanilla JavaScript

Tiempo de ejecución: 30 minutos. Empezar

Autor: dhcode
Views Total: 344
Sitio oficial: Ir a la web
Actualizado: March 23, 2019
Licencia: MIT

Vista prévia

Gran visor JSON de Performant en Vanilla JavaScript

Descripción

El visor de JSON grande le permite representar de forma eficaz datos JSON grandes en una vista de árbol plegable, embellecer .

¿Cómo funciona?

Instale el visor de Big JSON.

# NPM
$ npm install big-json-viewer
--save

Importe el módulo.

import { BigJsonViewerDom, BigJsonViewerOptions } from 'big-json-viewer';

Represente los datos JSON que proporcione de la siguiente manera:

BigJsonViewerDom.fromData(JSON.stringify({

test: 23,

someArray: [45, 2, 5, true, false, null]
})).then(viewer => {

const node = viewer.getRootElement();

document.body.appendChild(node);

node.openAll(1);

});

Opciones posibles para personalizar el visor de JSON.

{


// the maximum number of nodes

objectNodesLimit: 50,

 arrayNodesLimit: 50,


// if true the label for every node will show the full path to the element

labelAsPath: false


 }

Registro de cambios

v0.1.7 (03/23/2019)

  • Permitir undefined y cualquier tipo

v0.1.6 (01/16/2019)

  • Corrija la búsqueda y agregue pruebas

v0.1.5 (01/15/2019)

  • Corregir el envío de eventos y el colapso de objetos

Te puede interesar: