
Security News
Open Source CAI Framework Handles Pen Testing Tasks up to 3,600× Faster Than Humans
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
json-tree-viewer
Advanced tools
json formatter/viewer/pretty-printer (with jsonTree javascript-library)
The library and the viewer released under the MIT license (LICENSE.txt).
A simple json formatter/viewer based on jsonTree library and app.js framework.
Clone with submodules (including App.js library):
git clone --recursive https://github.com/summerstyle/jsonTreeViewer.git
Online: http://summerstyle.github.io/jsonTreeViewer
CTRL
/META
key)ALT
keySHIFT
keyA simple lightweight pure-javascript library for drawing tree of json-nodes from json-object.
You can get json-object from json-string by JSON.parse(str)
method.
Demo: http://summerstyle.github.io/jsonTreeViewer
The library includes only 2 files - libs/jsonTree/jsonTree.js
(18 KB)
and libs/jsonTree/jsonTree.css
(2 KB).
html:
<link href="libs/jsonTree/jsonTree.css" rel="stylesheet" />
<script src="libs/jsonTree/jsonTree.js"></script>
javascript:
// Get DOM-element for inserting json-tree
var wrapper = document.getElementById("wrapper");
// Get json-data by javascript-object
var data = {
"firstName": "Jonh",
"lastName": "Smith",
"phones": [
"123-45-67",
"987-65-43"
]
};
// or from a string by JSON.parse(str) method
var dataStr = '{ "firstName": "Jonh", "lastName": "Smith", "phones": ["123-45-67", "987-65-43"]}';
try {
var data = JSON.parse(dataStr);
} catch (e) {}
// Create json-tree
var tree = jsonTree.create(data, wrapper);
// Expand all (or selected) child nodes of root (optional)
tree.expand(function(node) {
return node.childNodes.length < 2 || node.label === 'phoneNumbers';
}
You can create many trees on one html-page.
loadData(jsonObj)
- Fill new data to current json treeappendTo(domEl)
- Appends tree to DOM-element (or move it to new place)expand()
- Expands all tree nodes (objects or arrays) recursivelyexpand(filterFunc)
- Expands only selected (by filter function) child nodes of root elementcollapse()
- Collapses all tree nodes (objects or arrays) recursivelyFAQs
json formatter/viewer/pretty-printer (with jsonTree javascript-library)
The npm package json-tree-viewer receives a total of 493 weekly downloads. As such, json-tree-viewer popularity was classified as not popular.
We found that json-tree-viewer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.