Renderjson

screenshot of Renderjson

Render JSON into collapsible HTML

Overview:

Renderjson is a streamlined library designed to transform JSON data into collapsible and themeable HTML, primarily aimed at developers looking to debug complex JSON structures. Its focus lies on simplicity, with minimal options and no external dependencies, making it accessible for quick integration into various projects. The unique lazy rendering feature accelerates the display of massive JSON objects by only constructing the HTML once the user expands sections, ensuring a swift initial load even with large datasets.

This library not only enhances readability through collapsible elements but also offers customization options to tailor the output to specific needs. Whether you are a developer seeking a straightforward debugging tool or a user wanting improved visual representation of JSON data, Renderjson provides the functionality needed to efficiently manage and display information.

Features:

  • Lazy Rendering: Generates HTML only when the JSON is revealed, optimizing performance for large datasets.
  • Custom Disclosure Icons: Use set_icons() to personalize the disclosure icons beyond the default "⊕" and "⊖".
  • Adjustable Display Levels: The set_show_to_level() function allows control over how much of the JSON is displayed by default, enhancing flexibility.
  • Expandable Strings: Strings over a specified length are truncated with the option to expand, keeping the interface neat.
  • Sorting Options: Automatically sort objects by key with a simple toggle, improving organization and readability.
  • Theme Customization: HTML output supports multiple classes for easy theming, allowing for a personalized visual style.
  • Chainable Functions: Easily combine multiple customization functions for tailored output without complex configurations.