
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
tree-crawl
Advanced tools
Generic tree traversal library.
tree-crawl is a lightweight tree crawler, well, technically walker. But the name was already taken you know...
It lets your easily walk any tree in pre-order or post-order. It supports in-place mutation of the tree including structural ones and does not 💥 when you move nodes around.
npm install --save tree-crawl
import crawl from 'tree-crawl'
// traverse the tree in pre-order
crawl(tree, console.log)
crawl(tree, console.log, { order: 'pre' })
// traverse the tree in post-order
crawl(tree, console.log, { order: 'post' })
// traverse the tree using `childNodes` as the children key
crawl(tree, console.log, { childrenKey: 'childNodes' }
// skip a node and its children
crawl(tree, (node, context) => {
if ('foo' === node.type) {
context.skip()
}
console.log(node)
})
// break the walk
crawl(tree, (node, context) => {
if ('foo' === node.type) {
console.log(node)
context.break()
}
})
// remove a node
crawl(tree, (node, context) => {
if ('foo' === node.type) {
const parentChildren = node.parent.children
parentChildren.splice(parentChildren.indexOf(node))
context.remove()
}
})
See the api documentation.
MIT © Nicolas Gryman
FAQs
Agnostic tree traversal library.
The npm package tree-crawl receives a total of 11,120 weekly downloads. As such, tree-crawl popularity was classified as popular.
We found that tree-crawl demonstrated a healthy version release cadence and project activity because the last version was released less than 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
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.