json-browse

0.2.0 • Public • Published

json-browse

json-browse is a jQuery plugin to easily browse and highlight your JSON.

  • Syntax highlighting
  • Collapse and expand child nodes on click
  • Clickable links
  • Easily readable and minimal DOM structure

demo page!

Usage

Import jquery.json-browse.js and jquery.json-browse.css in your application.

Then just call the jsonBrowse() method passing in an object:

<pre id="json-renderer" class="json-body"></pre>
var data = {
  "foobar": "foobaz"
};
$('#json-renderer').jsonBrowse(data);

Options

The jsonBrowse method accepts an optional options hash as a second argument:

Option Type Default Description
collapsed boolean false All nodes are collapsed.
withQuotes boolean false All JSON keys are surrounded with double quotation marks

Example:

$('#json-renderer').jsonBrowse(data, {collapsed: true, withQuotes: true});

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.2.0
    341
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.2.0
    341

Package Sidebar

Install

npm i json-browse

Weekly Downloads

341

Version

0.2.0

License

MIT

Last publish

Collaborators

  • acidjazz