
Security News
Open Source Maintainers Feeling the Weight of the EU’s Cyber Resilience Act
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
npm i treeboxjs
const TreeBox = require('treeboxjs');
...
<script type="module">
import TreeBox from 'path-to-module/dist/index.browser.js';
...
const TreeBox = require('treeboxjs');
const nodes = {
display: `<h1>treebox example</h1>`, // This will display by default when treebox is rendered
children: {
directory: {
children: {
file: {
display: `<p>A file</p>`,
},
},
},
file: {
display: String.raw`
<div>
<p>Another file</p>
<p>Multiple elements must be wrapped in a single enclosing element</p>
<a treebox-href="/directory/file">Link to /directory/file within treebox</a>
</div>
`.trim(),
},
},
};
// const root = document.getElementById('myTreeBoxRoot'); // if in the browser
const root = {
appendChild: (x) => console.log('Rendered:\n', x),
removeChild: () => console.log('\nCleared\n'),
};
const tb = new TreeBox({nodes, root}); // Initiate treebox and append it to the "root" element
tb.navigate('/file'); // This code will cause treebox to render the `display` HTML at `nodes.children.file`
tb.navigate('/directory/file'); // This code will cause treebox to render the `display` HTML at `nodes.children.directory.children.file`
tb.navigate('/'); // This code will cause treebox to render the `display` HTML at `nodes.children`
/* OUTPUT: */
/*
* Rendered:
* <h1>treebox example</h1>
*
* Cleared
*
* Rendered:
* <div>
* <p>Another file</p>
* <p>Multiple elements must be wrapped in a single enclosing element</p>
* <a treebox-href="/directory/file">Link to /directory/file within treebox</a>
* </div>
*
* Cleared
*
* Rendered:
* <p>A file</p>
*
* Cleared
*
* Rendered:
* <h1>treebox example</h1>
*/
FAQs
Display and navigate hierarchical views
The npm package treeboxjs receives a total of 4 weekly downloads. As such, treeboxjs popularity was classified as not popular.
We found that treeboxjs 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
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.