Categories: CSSScriptWeb Design

Performant Large JSON Viewer In Vanilla JavaScript

The Big JSON Viewer enables you to efficiently renders large JSON data in a collapsible, beautify tree view.

Table of Contents

Toggle

Basic usage:

Install the Big JSON Viewer.

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

Import the module.

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

Render the JSON data you provide as follows:

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);

});
Sponsored

Possible options to customize the JSON viewer.

{

  // 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,

  workerPath: null,
  collapseSameValue: 5,
  showExtendedJson: false,
  maxStringPreviewLength: 250,
  
}

Changelog:

v0.2.2 (12/01/2025)

Sponsored
  • Improve rendering for Extended JSON and for long strings

v0.1.7 (03/23/2019)

  • Allow undefined and any types

v0.1.6 (01/16/2019)

  • Fix search and add tests

v0.1.5 (01/15/2019)

  • Fix event dispatching and collapse of objects

The post Performant Large JSON Viewer In Vanilla JavaScript appeared first on CSS Script.

rssfeeds-admin

Share
Published by
rssfeeds-admin

Recent Posts

Qualcomm won’t be announcing Windows gaming handhelds at GDC after all

In January, Qualcomm hinted to The Verge that it might finally bring its powerful Arm-based…

5 minutes ago

DHS reportedly detained a Columbia University student and content creator

Students are seen on the campus of Columbia University on April 14, 2025, in New…

5 minutes ago

Today’s Best Deals: Pokémon Booster Bundle, Huge Woot Video Game Sale, and MTG x TMNT Boosters

If you’ve been waiting to grab any video games, today might be the day. On…

27 minutes ago

Samson: A Tyndalston Story Plays Like a Brawler Set in Max Payne’s New York – IGN Fan Fest

I first took notice of Samson: A Tyndalston Story when its team of former Just…

29 minutes ago

Stardew Valley Creator Unveils Two New Marriageable Characters Coming in 1.7

Stardew Valley creator Eric Barone (ConcernedApe) has released a 10th anniversary video revealing, among other…

29 minutes ago

Highguard Reportedly Has Less Than 20 Devs Working on It Following Mass Layoffs at Wildlight

Highguard studio Wildlight Entertainment reportedly has less than 20 people remaining to work on the…

30 minutes ago

This website uses cookies.