
Research
/Security News
Coruna Respawned: Compromised art-template npm Package Leads to iOS Browser Exploit Kit
Compromised npm package art-template delivered a Coruna-like iOS Safari exploit framework through a watering-hole attack.
@react-pdf/svg
Advanced tools
React renderer for creating PDF files on the browser and server
SVG string parser for react-pdf.
Parses SVG markup into a tree of nodes compatible with react-pdf's SVG primitives.
npm install @react-pdf/svg
# or
yarn add @react-pdf/svg
import { parseSvg } from '@react-pdf/svg';
const tree = parseSvg(
'<svg viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="red" /></svg>',
);
Returns an SvgNode tree:
{
type: 'SVG',
props: { viewBox: '0 0 100 100' },
children: [
{
type: 'CIRCLE',
props: { cx: '50', cy: '50', r: '40', fill: 'red' },
children: []
}
]
}
svg, g, path, rect, circle, ellipse, line, polyline, polygon, text, tspan, defs, clipPath, linearGradient, radialGradient, stop, image
parseSvg(svgString: string): SvgNodeParses an SVG string and returns the root SvgNode. Attributes are converted to camelCase and tag names are mapped to react-pdf primitive types. Unsupported elements are skipped with a console warning.
SvgNodeinterface SvgNode {
type: string;
props: Record<string, unknown>;
children?: SvgNode[];
}
MIT
FAQs
SVG parsing for react-pdf
The npm package @react-pdf/svg receives a total of 874,286 weekly downloads. As such, @react-pdf/svg popularity was classified as popular.
We found that @react-pdf/svg 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
Compromised npm package art-template delivered a Coruna-like iOS Safari exploit framework through a watering-hole attack.

Company News
As AI accelerates how code is written and shipped, Socket is scaling to protect the software supply chain from the growing wave of attacks targeting open source dependencies.

Company News
Socket is scaling to defend open source against supply chain attacks as AI accelerates software development.