Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
use-checkbox-tree
Advanced tools
React hook for checkbox tree component
npm i use-checkbox-tree
import ReactDOM from 'react-dom';
import useCheckboxTree from 'use-checkbox-tree';
const nodes = [
{
id: 1,
children: [
{
id: 1.1,
},
{
id: 1.2,
},
],
},
];
const initialValue = [];
const TreeComponent = () => {
const { checked, indeterminates, state, selectNode } = useCheckboxTree(nodes, initialValue);
// checked -> [1.2]
// indeterminates -> [1]
// state.get(1) -> 'indeterminate'
return (
// iterate through nodes and create your own tree view
<div />
);
};
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(<TreeComponent />);
selectNode(1); // select a node
deSelectNode(1); // deselect a node
selectNode(1, true); // select a node
selectNode(1, false); // deselect a node
clear - a function to clear all selected items
state - object with id as key and value as boolean | indeterminate
Map{
1: "indeterminate",
1.1: true,
1.2: false
}
FAQs
React hook for checkbox tree component
The npm package use-checkbox-tree receives a total of 338 weekly downloads. As such, use-checkbox-tree popularity was classified as not popular.
We found that use-checkbox-tree 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.