
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
svg-visitor
Advanced tools
visit svg element use visitor pattern
npm install svg-visitor
import { svgVisitor } from 'svg-visitor';
const svgDom = document.getElementByTagName('svg')[0]
svgVisitor(svgDom, {
rectVisitor: function (rectDom) {
const fill = rectDom.getAttribute('fill')
if (fill === '#f00') {
rectDom.setAttribute('fill', "#0f0")
}
}
})
before
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="40" height="40" >
<rect width="40" height="40" x="0" y="0" id="0" fill="#f00"></rect>
</svg>
after
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="40" height="40" >
<rect width="40" height="40" x="0" y="0" id="0" fill="#0f0"></rect>
</svg>
import { svgVisitor } from 'svg-visitor';
const svgDom = document.getElementByTagName('svg')[0]
svgVisitor(svgDom, {
// visit all svg element under svgDom
visitor: function(dom){},
// visit <rect>...</rect>
rectVisitor: function (rectDom) {},
// visit <circle>...</circle>
circleVisitor: function (circleDom) {},
...
})
npm run-script test
FAQs
visit svg element use visitor pattern
We found that svg-visitor 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.