Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
This project is a utility for configure a json and parse to ul/li tree.
npm install json2tree
Sample of configure
[
//Define a folder
{ "name": "Node Name",
"type": "folder",
"nodes":[
//Define files or folder inside a folder
{"type":"node","link":"http://www.google.com","name":"External link"},
{"type":"node","link":"/test.html","name":"Internal link"},
{"type":"node","link":"mailto:xxx@ooo.com","name":"mail link"},
[
"name": "Node Name",
"type": "folder",
"nodes":[
....
]
]
...
]
},
...
]
var j2t = require('json2table');
var out = j2t.toUlTree(
[
{ "name": "Level 1 Folder",
"type": "folder",
"nodes":[
{"type":"node","link":"http://www.google.com","name":"node1"},
{
"name": "Level 2 Folder",
"type": "folder",
"nodes":[
{"type":"node","link":"http://www.google.com","name":"node1.1"},
{"type":"node","link":"http://www.google.com","name":"node1.2"}
]
}
]
}
]
);
console.log(out);
Output:
<ul id="browser" class="filetree"><span style="font-size:+1"></span><li><span class="folder">Level 1 Folder</span><ul> <li><span class="file"><a href="http://www.google.com">node1</a></span></li><li><span class="folder">Level 2 Folder</span><ul> <li><span class="file"><a href="http://www.google.com">node1.1</a></span></li><li><span class="file"><a href="http://www.google.com">node1.2</a></span></li></ul></li></ul></li></ul>
See test.html
FAQs
Json to Tree Utility
The npm package json2tree receives a total of 2 weekly downloads. As such, json2tree popularity was classified as not popular.
We found that json2tree 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.